-
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (62 loc) · 2.13 KB
/
master.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: "CI/CD"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: "⚙ Set up Node.js"
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: "✅ Checkout repository"
uses: actions/checkout@v2
build:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "💾 Restore Dependencies from cache"
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: "📦 Install Dependencies"
run: npm install
- name: "🔦 Lint"
run: npm run lint
- name: "🔨 Build"
run: npm run build
- name: "👨💻 Run Test"
run: npm run test
env:
NODE_ENV: 'test'
- name: "📊 Upload coverage report to Codecov"
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: "📊 SonarCloud Scan"
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.projectName=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8
-Dsonar.sources=./src
-Dsonar.exclusions=**/*.bin,node_modules/**,test/**,**/__test__/**,**/__mocks__/**,src/index.ts
-Dsonar.coverage.exclusions=node_modules/**,test/**,**/__test__/**,**/__mocks__/**,src/index.ts
-Dsonar.testExecutionReportPaths=test-report.xml
-Dsonar.typescript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}