Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to check code generation #866

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/code_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check Code Generation

on:
pull_request:
branches: [main]
paths:
- '.github/workflows/code_generation.yml'
- 'packages/generator/bin/**'
- 'packages/generator/lib/**'
- 'packages/generator/analysis_options.yaml'
- 'packages/generator/pubspec.yaml'
push:
branches: [main]
paths:
- '.github/workflows/code_generation.yml'
- 'packages/generator/bin/**'
- 'packages/generator/lib/**'
- 'packages/generator/analysis_options.yaml'
- 'packages/generator/pubspec.yaml'

jobs:
check_generation:
runs-on: windows-2019
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4

- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1

- name: 📦 Install Workspace Dependencies
run: dart pub get

- name: 📦 Install package:win32 Dependencies
run: dart pub get
working-directory: packages/win32

- name: 📦 Install package:generator Dependencies
run: dart pub get
working-directory: packages/generator

- name: 🛠️ Install Melos
run: dart pub global activate melos

- name: 🚀 Run Code Generation
run: dart pub run melos run generate

- name: 🔍 Verify Code Generation
run: git diff --exit-code
2 changes: 0 additions & 2 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
sdk: beta
- os: windows-2019
sdk: stable
- os: ubuntu-latest
sdk: stable

uses: halildurmus/halildurmus/.github/workflows/dart_package.yml@main
with:
Expand Down
2 changes: 1 addition & 1 deletion examples/explorer/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: win32
dependency_overrides:
win32:
path: ..\\..\\packages\\win32
path: ../../packages/win32
2 changes: 1 addition & 1 deletion examples/service_manager_cli/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: win32
dependency_overrides:
win32:
path: ..\\..\\packages\\win32
path: ../../packages/win32
2 changes: 1 addition & 1 deletion examples/task_manager/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: win32
dependency_overrides:
win32:
path: ..\\..\\packages\\win32
path: ../../packages/win32
2 changes: 1 addition & 1 deletion packages/generator/bin/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void main() async {
print('Generating FFI function bindings...');
generateFunctions([wdkScope, win32Scope], functionsToGenerate);

print('Generating COM interfaces and tests...');
print('Generating COM interfaces...');
final comTypesToGenerate = loadMap('com_types.json');
saveMap(comTypesToGenerate, 'com_types.json');
generateComApis(win32Scope, comTypesToGenerate);
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: win32
dependency_overrides:
win32:
path: ..\\win32
path: ../win32
17 changes: 0 additions & 17 deletions packages/generator/test/generator_neutrality_test.dart

This file was deleted.