Phase 09: CI Pipeline Hardening - 4 plan(s) in 3 wave(s) - Wave 1: Infrastructure setup (09-01) - Wave 2: Tests in parallel (09-02, 09-03) - Wave 3: CI integration (09-04) - Ready for execution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6.7 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, user_setup, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | user_setup | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 09-ci-pipeline | 04 | execute | 3 |
|
|
false |
|
|
Purpose: Ensure tests run automatically on every push/PR and block deployment when tests fail. This is the final piece that makes the test infrastructure actually protect production.
Output: Updated CI workflow with test job that runs before build, fail-fast on errors, and Slack notification on failure.
<execution_context> @/home/tho/.claude/get-shit-done/workflows/execute-plan.md @/home/tho/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/phases/09-ci-pipeline/09-RESEARCH.md @.planning/phases/09-ci-pipeline/09-02-SUMMARY.md @.planning/phases/09-ci-pipeline/09-03-SUMMARY.md@.gitea/workflows/build.yaml @package.json
Task 1: Add test job to CI pipeline .gitea/workflows/build.yaml Update .gitea/workflows/build.yaml to add a test job that runs BEFORE build:- Add new
testjob at the beginning of jobs section:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run type check
run: npm run check -- --output machine
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run unit tests with coverage
run: npm run test:coverage
- name: Run E2E tests
run: npm run test:e2e
env:
CI: true
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
coverage/
playwright-report/
test-results/
retention-days: 7
- Modify existing
buildjob to depend on test:
build:
needs: test
runs-on: ubuntu-latest
# ... existing steps ...
This ensures build only runs if tests pass (fail-fast behavior).
YAML syntax is valid: python3 -c "import yaml; yaml.safe_load(open('.gitea/workflows/build.yaml'))"
Build job has needs: test dependency
Test job added to pipeline. Build job depends on test job (fail-fast).
notify:
needs: [test, build]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Notify Slack on failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"Pipeline failed for ${{ gitea.repository }} on ${{ gitea.ref }}\"}" \
$SLACK_WEBHOOK_URL
Note: Using direct curl to Slack webhook rather than a GitHub Action for maximum Gitea compatibility (per RESEARCH.md recommendation).
The SLACK_WEBHOOK_URL secret must be configured in Gitea repository settings by the user (documented in user_setup frontmatter).
YAML syntax is valid
Notify job has if: failure() condition
Notify job depends on both test and build
Slack notification configured for pipeline failures.
<success_criteria>
- CI-02 satisfied: Unit tests run in pipeline before build
- CI-03 satisfied: Type checking runs in pipeline
- CI-04 satisfied: E2E tests run in pipeline
- CI-05 satisfied: Pipeline fails fast on test/type errors (needs: test)
- Slack notification on failure (per CONTEXT.md decision)
- Test artifacts uploaded for debugging failed runs </success_criteria>