Add verification workflow for generated code and OpenAPI spec
All checks were successful
Test / test-frontend (pull_request) Successful in 24s
Test / frontend-build (pull_request) Successful in 24s
Verify / verify-generated-code (pull_request) Successful in 7m58s
Verify / verify-openapi-spec (pull_request) Successful in 1m12s
Test / test (pull_request) Successful in 1m12s
Test / lint (pull_request) Successful in 1m11s

This commit is contained in:
GW_MC
2025-12-05 19:00:04 +08:00
parent 81fbf8281f
commit 1c051f9502
2 changed files with 112 additions and 28 deletions

View File

@@ -16,33 +16,6 @@ jobs:
# the workflow DRY. The composite action performs checkout, cache restore and
# toolchain setup.
verify-generated-code:
# no need to depend on a separate setup job; the composite action runs in
# this job and restores caches/toolchain here.
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Rust, checkout and restore caches
uses: ./.github/actions/setup-rust
- name: generate entities from migration files
run: |
cd apps/cli
cargo run -- db:migrate_and_generate --output-path ../../public/database/src/generated/entities
- name: Check for uncommitted changes in /generated/
run: |
if [[ -n $(git status --porcelain | grep '^ M .*\/generated\/') ]]; then
echo "Generated code is not up to date. Please run the code generation locally and commit the changes."
git status --porcelain | grep '^ M .*\/generated\/'
exit 1
else
echo "Generated code is up to date."
fi
test:
needs: frontend-build
runs-on: ubuntu-latest
@@ -94,7 +67,6 @@ jobs:
- name: Check code formatting
run: cargo fmt --all -- --check
test-frontend:
runs-on: ubuntu-latest
steps: