-
Notifications
You must be signed in to change notification settings - Fork 27
165 lines (130 loc) · 4.1 KB
/
node.js.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Install, Test, Build
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.17.4
- name: Install dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Run ESLint
run: yarn eslint-check
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.17.4
- name: Install dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Build
run: yarn build
unit-integration-test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.17.4
- name: Install dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Unit and Integration Test
run: yarn test:coverage
env:
NEW_RELIC_ENABLED: false
- name: Upload a Coverage Artifact
uses: actions/[email protected]
with:
name: coverage
path: coverage/
retention-days: 1
mutation-test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.17.4
- name: Install dependencies
run: yarn --prefer-offline --frozen-lockfile
- name: Mutation Test
run: yarn test:mutation
env:
NEW_RELIC_ENABLED: false
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
sonar-coverage:
needs: unit-integration-test
if: ${{github.base_ref != 'dev'}}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download Coverage Artifact
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=${{ secrets.SONAR_ORG }}
-Dsonar.projectKey=${{ secrets.SONAR_PROJ_KEY }}
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.sources=src/
-Dsonar.coverage.exclusions=src/server.js,src/utils/config.js,src/utils/api/**,src/utils/caching/**,src/utils/logger/**,src/utils/monitoring/**,src/utils/tracing/**
-Dsonar.test.exclusions=test/**
-Dsonar.tests=test/
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
coveralls:
needs: unit-integration-test
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Download Coverage Artifact
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
sentry-release:
needs: [lint, build, unit-integration-test]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Create Sentry release
if: ${{ github.repository_owner == 'CougarCS' && !contains(toJSON(github.event), 'pull_request')}}
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production