-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (52 loc) · 1.53 KB
/
frontend-tests.yaml
File metadata and controls
62 lines (52 loc) · 1.53 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Frontend Tests
on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- "frontend/**"
pull_request:
branches: ["main"]
paths:
- "frontend/**"
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
jobs:
frontend_tests:
if: "! github.event.pull_request.draft"
runs-on: ubuntu-latest
name: Frontend Tests
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: ./frontend
run: npm install
- name: Run tests with coverage
working-directory: ./frontend
run: CI=true npm run test -- --coverage .
- name: Git fetch unshallow
if: ${{ github.actor != 'dependabot[bot]' }}
run: git fetch --unshallow
- name: UI SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v3
if: ${{ github.actor != 'dependabot[bot]' }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: ./frontend
args: >
-Dproject.settings=./sonar-project.properties