-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.45 KB
/
frontend_tests.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
45
46
47
48
49
50
51
52
name: frontend tests
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "frontend/**"
pull_request:
paths:
- "frontend/**"
jobs:
fe-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: "install node v20.15 and cash npm"
uses: actions/setup-node@v4
with:
node-version: 20.15
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: "install dependencies"
working-directory: frontend
run: npm install --frozen-lockfile --silent
- name: "run eslint check"
working-directory: frontend
run: npm run lint
- name: "run unit test"
working-directory: frontend
run: npm run test:coverage
# - name: Cache SonarCloud packages
# uses: actions/cache@v4
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
# - name: SonarCloud Scan frontend
# uses: sonarsource/sonarcloud-github-action@master
# with:
# projectBaseDir: frontend
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: "run build test"
working-directory: frontend
run: npm run build