-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (51 loc) · 1.32 KB
/
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
53
name: Lint, build and test
on:
push:
branches:
- main
- develop
- '*'
pull_request:
branches: [ develop ]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Pull the source code to GitHub workspace
uses: actions/checkout@v4
- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Run lint
if: ${{ success() }}
run: yarn run lint
- name: Run build
run: yarn run build
- name: Run tests
if: ${{ success() }}
run: yarn run test
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Test and coverage
run: yarn run test:coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}