|
8 | 8 | - ".github/workflows/frontend.yml" |
9 | 9 | - "src/frontend/task-agent-web/**" |
10 | 10 | - "!src/frontend/task-agent-web/**/*.md" |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - main |
| 14 | + paths: |
| 15 | + - "src/frontend/task-agent-web/**" |
| 16 | + - "!src/frontend/task-agent-web/**/*.md" |
11 | 17 |
|
12 | 18 | jobs: |
13 | | - build_and_deploy: |
| 19 | + test: |
14 | 20 | runs-on: ubuntu-latest |
15 | | - name: Build and Deploy |
| 21 | + timeout-minutes: 30 |
| 22 | + name: Test |
| 23 | + defaults: |
| 24 | + run: |
| 25 | + working-directory: src/frontend/task-agent-web |
16 | 26 | steps: |
17 | | - - uses: actions/checkout@v4 |
| 27 | + - uses: actions/checkout@v5 |
| 28 | + |
| 29 | + # Setup pnpm BEFORE setup-node (required for cache: 'pnpm' to work) |
| 30 | + - name: Setup pnpm |
| 31 | + uses: pnpm/action-setup@v4 |
18 | 32 | with: |
19 | | - submodules: true |
| 33 | + version: 9 |
20 | 34 |
|
21 | 35 | - name: Setup Node.js |
22 | 36 | uses: actions/setup-node@v4 |
23 | 37 | with: |
24 | 38 | node-version: "20" |
| 39 | + cache: "pnpm" |
| 40 | + cache-dependency-path: src/frontend/task-agent-web/pnpm-lock.yaml |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: pnpm install --frozen-lockfile |
| 44 | + |
| 45 | + - name: Run Unit Tests with Coverage |
| 46 | + run: pnpm test:coverage |
| 47 | + |
| 48 | + - name: Upload Unit Test Coverage Report |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + if: ${{ !cancelled() }} |
| 51 | + with: |
| 52 | + name: unit-test-coverage |
| 53 | + path: src/frontend/task-agent-web/coverage/ |
| 54 | + retention-days: 30 |
| 55 | + |
| 56 | + - name: Install Playwright Browsers |
| 57 | + run: npx playwright install --with-deps chromium |
| 58 | + |
| 59 | + - name: Run E2E Tests |
| 60 | + run: pnpm test:e2e |
| 61 | + |
| 62 | + - name: Upload E2E Test Report |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + if: ${{ !cancelled() }} |
| 65 | + with: |
| 66 | + name: playwright-report |
| 67 | + path: src/frontend/task-agent-web/playwright-report/ |
| 68 | + retention-days: 30 |
| 69 | + |
| 70 | + - name: Upload E2E Test Results |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + if: failure() |
| 73 | + with: |
| 74 | + name: playwright-test-results |
| 75 | + path: src/frontend/task-agent-web/test-results/ |
| 76 | + retention-days: 7 |
| 77 | + |
| 78 | + build_and_deploy: |
| 79 | + runs-on: ubuntu-latest |
| 80 | + timeout-minutes: 15 |
| 81 | + needs: test |
| 82 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 83 | + name: Build and Deploy |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v5 |
| 86 | + with: |
| 87 | + submodules: true |
25 | 88 |
|
26 | 89 | - name: Setup pnpm |
27 | | - uses: pnpm/action-setup@v2 |
| 90 | + uses: pnpm/action-setup@v4 |
28 | 91 | with: |
29 | 92 | version: 9 |
30 | 93 |
|
| 94 | + - name: Setup Node.js |
| 95 | + uses: actions/setup-node@v4 |
| 96 | + with: |
| 97 | + node-version: "20" |
| 98 | + cache: "pnpm" |
| 99 | + cache-dependency-path: src/frontend/task-agent-web/pnpm-lock.yaml |
| 100 | + |
31 | 101 | - name: Install dependencies |
32 | 102 | run: | |
33 | 103 | cd src/frontend/task-agent-web |
|
0 commit comments