-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (42 loc) · 1.21 KB
/
test-frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Tests
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
frontend:
- 'frontend/**'
- '.github/workflows/*'
- name: Use Node.js 18.x
uses: actions/setup-node@v3
if: steps.filter.outputs.frontend == 'true'
with:
node-version: 18.x
- name: Install dependencies
if: steps.filter.outputs.frontend == 'true'
run: yarn install --frozen-lockfile
working-directory: ./frontend
- name: Build frontend
if: steps.filter.outputs.frontend == 'true'
run: yarn build
working-directory: ./frontend
- name: Run tests
if: steps.filter.outputs.frontend == 'true'
run: yarn test --coverage --watchAll=false
working-directory: ./frontend
- name: Upload coverage to Codecov
if: steps.filter.outputs.frontend == 'true'
uses: codecov/codecov-action@v3
with:
flags: frontend
fail_ci_if_error: true
directory: ./frontend