Skip to content

Commit 0fecd61

Browse files
committed
ci(frontend): update GitHub Actions workflow for testing and deployment
Enhanced the CI/CD pipeline by adding unit and E2E testing steps. Updated Node.js and pnpm versions, and improved caching for faster builds. Modified files (1): - .github/workflows/frontend.yml: Added testing steps and updated configurations
1 parent d35cc91 commit 0fecd61

1 file changed

Lines changed: 75 additions & 5 deletions

File tree

.github/workflows/frontend.yml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,96 @@ on:
88
- ".github/workflows/frontend.yml"
99
- "src/frontend/task-agent-web/**"
1010
- "!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"
1117

1218
jobs:
13-
build_and_deploy:
19+
test:
1420
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
1626
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
1832
with:
19-
submodules: true
33+
version: 9
2034

2135
- name: Setup Node.js
2236
uses: actions/setup-node@v4
2337
with:
2438
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
2588

2689
- name: Setup pnpm
27-
uses: pnpm/action-setup@v2
90+
uses: pnpm/action-setup@v4
2891
with:
2992
version: 9
3093

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+
31101
- name: Install dependencies
32102
run: |
33103
cd src/frontend/task-agent-web

0 commit comments

Comments
 (0)