ci(rust): fix cache thrashing that forced cold compiles every run #337
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenAPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/openapi-rust.yaml" | |
| - ".github/actions/rust-setup/**" | |
| - "Cargo.*" | |
| - "modules/meteroid/src/api_rest/**" | |
| pull_request: | |
| types: [ opened, reopened, synchronize ] | |
| paths: | |
| - ".github/workflows/openapi-rust.yaml" | |
| - ".github/actions/rust-setup/**" | |
| - "Cargo.*" | |
| - "modules/meteroid/src/api_rest/**" | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| env: | |
| # Trim debug info in CI only: faster codegen/linking, lighter cache. | |
| CARGO_PROFILE_DEV_DEBUG: line-tables-only | |
| jobs: | |
| openapi: | |
| name: Open API | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/rust-setup | |
| - name: Validate OpenAPI | |
| run: | | |
| cargo run --locked -p meteroid --bin openapi-generate | |
| if [[ -n "$(git status --porcelain spec/api/v1/openapi.json)" ]]; then | |
| echo "openapi.json is not up to date. Please run 'cargo run -p meteroid --bin openapi-generate' and commit changes." | |
| git --no-pager diff spec/api/v1/openapi.json | |
| exit 1 | |
| fi |