-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.16 KB
/
test-and-lint.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
name: Test and lint
on: push
jobs:
test:
name: Run all tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install
run: yarn install --frozen-lockfile
- name: Test
run: yarn test
unit-test-and-sonar:
name: Unit tests and coverage for sonar
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install
run: yarn install --frozen-lockfile
- name: Test
run: yarn test:unit --coverage
- name: Setup Sonar Scanner
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.host.url=https://sonarcloud.io/