-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.31 KB
/
frontend-ci.yaml
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
45
46
47
name: frontend service ci
on:
push:
branches: [ "master" ]
paths:
- "frontend/**"
- ".github/workflows/actions/action.yaml"
- ".github/workflows/frontend-ci.yaml"
pull_request:
branches: [ "master" ]
paths:
- "frontend/**"
- ".github/workflows/actions/action.yaml"
- ".github/workflows/frontend-ci.yaml"
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
working-directory: frontend
- run: npm run build
working-directory: frontend
- run: npx prettier --check .
working-directory: frontend
# Step 4: Run tests
- name: Run tests
run: npm test -- --watchAll=false
# Step 5: Upload test results (optional, if you want test reports)
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-results