forked from segmentio/analytics-node
-
Notifications
You must be signed in to change notification settings - Fork 13
51 lines (43 loc) · 1.21 KB
/
test.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
name: 'Unit Tests, Coverage & Sonar'
on:
workflow_dispatch:
push:
branches: ['master', 'develop']
pull_request:
branches: ['master', 'develop']
types: ['opened', 'reopened', 'synchronize']
jobs:
build:
name: 'Unit Tests, Coverage & Sonar'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Execute unit tests
env:
HUSKY: 0
run: |
npm ci
npm run test:ci
npm run check:lint:ci
- name: Fix filesystem paths in generated reports
run: |
./scripts/fix-reports-path-in-github-runner.sh
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage/clover.xml