fix(api): stop test-runs/count from preloading and discarding every run (#138) #1183
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: PR Validation | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize] | |
| paths-ignore: | |
| - '.github/CODEOWNERS' | |
| - '.github/SECURITY.md' | |
| - '.slsa-goreleaser/**' | |
| - '.gitignore' | |
| - 'docs/**' | |
| - '**.md' | |
| jobs: | |
| validate-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check PR Title | |
| uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| docs | |
| style | |
| refactor | |
| perf | |
| test | |
| build | |
| ci | |
| chore | |
| revert | |
| requireScope: false | |
| subjectPattern: ^(?![A-Z]).+$ | |
| subjectPatternError: | | |
| The subject "{subject}" found in the pull request title "{title}" | |
| didn't match the configured pattern. Please ensure that the subject | |
| doesn't start with an uppercase character. | |
| # The server embeds the SPA via //go:embed internal/web/dist, which is a | |
| # committed build artifact. If someone changes web-v2/src but forgets to | |
| # rebuild + restage internal/web/dist, a stale SPA ships silently. This | |
| # job rebuilds the SPA and fails if the committed dist drifts from source. | |
| check-embed-fresh: | |
| runs-on: ubuntu-latest | |
| needs: validate-pr | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 20 | |
| - name: Build and stage web-v2 SPA | |
| run: | | |
| corepack enable | |
| cd web-v2 | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| cd .. | |
| rm -rf internal/web/dist | |
| mkdir -p internal/web/dist | |
| cp -R web-v2/dist/. internal/web/dist/ | |
| - name: Fail if the embedded SPA is stale | |
| run: | | |
| if ! git diff --quiet -- internal/web/dist; then | |
| echo "::error::internal/web/dist is out of sync with web-v2/src." | |
| echo "Rebuild and restage the SPA, then commit internal/web/dist:" | |
| echo " cd web-v2 && pnpm build && cd .. && rm -rf internal/web/dist && mkdir -p internal/web/dist && cp -R web-v2/dist/. internal/web/dist/" | |
| git status --short -- internal/web/dist | |
| exit 1 | |
| fi | |
| echo "Embedded SPA is in sync with web-v2/src." | |
| check-acceptance-tests: | |
| runs-on: ubuntu-latest | |
| needs: validate-pr | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| persist-credentials: false | |
| - name: Run acceptance tests with Dagger | |
| uses: dagger/dagger-for-github@e47aba410ef9bb9ed81a4d2a97df31061e5e842e # 8.0.0 | |
| with: | |
| verb: call | |
| module: ./ci | |
| args: acceptance-test --source . | |
| continue-on-error: true | |
| - name: Comment PR | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | |
| if: failure() | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '⚠️ Acceptance tests failed. Please check the logs and fix any issues.' | |
| }) |