chore(release): promote develop to main #32
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: Phase Gates | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| phase-gates-summary: | |
| name: Phase Gates Summary | |
| runs-on: ubuntu-latest | |
| env: | |
| PHASE_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }} | |
| steps: | |
| - name: Explain phase-gate applicability | |
| run: | | |
| set -euo pipefail | |
| if echo ",$PHASE_LABELS," | grep -Eq ',phase:(sdd|bdd|tdd|ddd),'; then | |
| echo "::notice::Phase gate active for labels: $PHASE_LABELS" | |
| else | |
| echo "::notice::No phase:* label declared; phase gates are not applicable for this PR." | |
| echo "::notice::General repository quality is owned by Test & Quality; package compatibility is owned by Granular Matrix Tests." | |
| fi | |
| sdd-gate: | |
| needs: phase-gates-summary | |
| if: contains(github.event.pull_request.labels.*.name, 'phase:sdd') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify Specs/ADR Changes | |
| run: | | |
| git fetch origin main | |
| CHANGES=$(git diff --name-only origin/main...HEAD | grep "^specs/" || true) | |
| if [ -z "$CHANGES" ]; then | |
| echo "::error::No changes found in specs/ directory. SDD phase requires design documentation." | |
| exit 1 | |
| fi | |
| - name: Check for TODO/TBD in specs | |
| run: | | |
| if grep -rE "TODO|TBD" specs/; then | |
| echo "::error::Found TODO or TBD in specs. SDD must be complete and finalized." | |
| exit 1 | |
| fi | |
| bdd-gate: | |
| needs: phase-gates-summary | |
| if: contains(github.event.pull_request.labels.*.name, 'phase:bdd') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: ./.github/actions/setup | |
| with: | |
| turbo-cache-api: ${{ secrets.TURBO_CACHE_API_URL }} | |
| turbo-cache-token: ${{ secrets.TURBO_CACHE_TOKEN }} | |
| is-pr: "true" | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - name: Ensure tests fail (Red Phase) | |
| run: | | |
| echo "🔍 Verifying Red Phase: Integration tests should FAIL." | |
| # We run only integration tests and expect them to exit with non-zero | |
| # If they PASS, it means the 'new' behavior isn't actually missing or a regression isn't being caught. | |
| pnpm run test:integration && (echo "::error::Tests passed but were expected to FAIL in BDD Red Phase." && exit 1) || (echo "✅ Tests failed as expected for Red Phase." && exit 0) | |
| tdd-gate: | |
| needs: phase-gates-summary | |
| if: contains(github.event.pull_request.labels.*.name, 'phase:tdd') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: ./.github/actions/setup | |
| with: | |
| turbo-cache-api: ${{ secrets.TURBO_CACHE_API_URL }} | |
| turbo-cache-token: ${{ secrets.TURBO_CACHE_TOKEN }} | |
| is-pr: "true" | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - name: Unit Tests and Coverage | |
| run: | | |
| # Enforce unit tests pass and check coverage | |
| pnpm run test:unit -- --coverage | |
| # The coverage report should exist. Higher level thresholds are handled in vitest/turbo config. | |
| ddd-gate: | |
| needs: phase-gates-summary | |
| if: contains(github.event.pull_request.labels.*.name, 'phase:ddd') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Explain DDD gate scope | |
| run: | | |
| echo "::notice::DDD phase gate validates delivery metadata only." | |
| echo "::notice::Build/lint/type/test health is owned by Test & Quality." | |
| - name: Verify Changeset | |
| run: | | |
| # Verify that at least one changeset exists (excluding README) | |
| if [ ! -d ".changeset" ] || [ $(ls .changeset/*.md | grep -v README.md | wc -l) -eq 0 ]; then | |
| echo "::error::No changeset found. DDD phase requires documentation of changes for release." | |
| exit 1 | |
| fi |