Skip to content

Commit

Permalink
feat(ci): Validate code generation
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin committed Oct 29, 2023
1 parent cf137e2 commit e215b73
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 23 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Generate
on:
push:
branches:
- main
paths:
- external/**
- tool/**
- packages/dynamite/**
- packages/nextcloud/**
pull_request:
paths:
- external/**
- tool/**
- packages/dynamite/**
- packages/nextcloud/**

concurrency:
group: generate-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
dart:
name: Dart
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0

- name: Install dart
uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # v1
- name: Setup
run: ./tool/setup.sh

- name: Generate dynamite end to end test
run: |
./tool/generate-dynamite-e2e-test.sh
if [ -n "$(git status --porcelain)" ]; then
git --no-pager diff
exit 1
fi
- name: Generate nextcloud
run: |
./tool/generate-nextcloud.sh
if [ -n "$(git status --porcelain)" ]; then
git --no-pager diff
exit 1
fi
openapi:
name: OpenAPI
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Submodules
run: git submodule update --init --depth 0

- name: Install php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer

- name: Generate specs
run: |
./tool/generate-specs.sh
if [ -n "$(git status --porcelain)" ]; then
git --no-pager diff
exit 1
fi
8 changes: 0 additions & 8 deletions packages/dynamite/dynamite_end_to_end_test/generate.sh

This file was deleted.

1 change: 0 additions & 1 deletion packages/dynamite/dynamite_end_to_end_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies:

dev_dependencies:
build_runner: ^2.4.6
build_verify: ^3.1.0
built_value_generator: ^8.6.3
dynamite:
git:
Expand Down

This file was deleted.

4 changes: 3 additions & 1 deletion tool/generate-dynamite-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ cd "$(dirname "$0")/.."
(
cd packages/dynamite/dynamite_end_to_end_test
rm -rf .dart_tool/build/generated/dynamite
bash generate.sh
fvm dart pub run build_runner build --delete-conflicting-outputs
fvm dart fix --apply lib/
melos run format
)

0 comments on commit e215b73

Please sign in to comment.