Restore CI and contract workflows #49
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: Contract | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| schedule: | |
| # Daily nightly run at 06:00 UTC catches drift from upstream API changes | |
| # captured into fixtures/ between merges. | |
| - cron: "0 6 * * *" | |
| repository_dispatch: | |
| # Fired by audd-openapi on every merge to main; re-run our parser against | |
| # the latest spec to catch contract drift before it reaches users. | |
| types: [openapi-updated] | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| contract: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: audd-node | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: AudDMusic/audd-openapi | |
| path: audd-openapi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: audd-node/package-lock.json | |
| - working-directory: audd-node | |
| run: npm ci | |
| - working-directory: audd-node | |
| env: | |
| AUDD_OPENAPI_FIXTURES: ${{ github.workspace }}/audd-openapi/fixtures | |
| run: npx vitest run test/contract.test.ts |