mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
ci: add client test job and split coverage artifacts
Run frontend tests in parallel with backend tests on every PR. Rename the server artifact to backend-coverage and upload client coverage as frontend-coverage.
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'server/**'
|
- 'server/**'
|
||||||
- '.github/workflows/test.yml'
|
- '.github/workflows/test.yml'
|
||||||
|
- 'client/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
server-tests:
|
server-tests:
|
||||||
@@ -34,6 +35,33 @@ jobs:
|
|||||||
if: success()
|
if: success()
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: coverage
|
name: backend-coverage
|
||||||
path: server/coverage/
|
path: server/coverage/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
client-tests:
|
||||||
|
name: Client Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: client/package-lock.json
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: cd client && npm ci
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cd client && npm run test:coverage
|
||||||
|
|
||||||
|
- name: Upload coverage
|
||||||
|
if: success()
|
||||||
|
uses: actions/upload-artifact@v6
|
||||||
|
with:
|
||||||
|
name: frontend-coverage
|
||||||
|
path: client/coverage/
|
||||||
|
retention-days: 7
|
||||||
|
|||||||
Reference in New Issue
Block a user