Image generator: pet NFT art service, generated from DNA via Cloudflare Workers AI #81
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: Coverage | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| # Allow the workflow to create / update the coverage comment on the PR. | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: coverage-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # Each suite runs even if an earlier one fails (if: always()), so the | |
| # aggregated comment covers every package. A failing suite still fails | |
| # the job overall, preserving the test signal. | |
| - name: Backend coverage | |
| run: pnpm --filter backend test:coverage | |
| - name: Frontend coverage | |
| if: always() | |
| run: pnpm --filter frontend test:coverage | |
| - name: Shared coverage | |
| if: always() | |
| run: pnpm --filter '@shared/core' test:coverage | |
| - name: Build coverage comment | |
| if: always() | |
| run: node scripts/coverage-comment.mjs > coverage-comment.md | |
| # One sticky comment, updated in place, with all three packages in a | |
| # single table on the PR conversation. | |
| - name: Post coverage comment | |
| if: always() && github.event_name == 'pull_request' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| header: coverage | |
| path: coverage-comment.md |