Skip to content

Commit

Permalink
Add workflow to check code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus committed Jul 24, 2024
1 parent 34ff723 commit 70978fc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 20 deletions.
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 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
17 changes: 0 additions & 17 deletions packages/generator/test/generator_neutrality_test.dart

This file was deleted.

0 comments on commit 70978fc

Please sign in to comment.