-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (155 loc) · 4.23 KB
/
ci.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
name: ci
on:
push:
branches: [master, alpha, beta, next]
pull_request:
types: [opened, synchronize, reopened]
jobs:
qa-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Lint markdown
run: yarn lint:markdown
- name: Check package.json quality
run: yarn check:packagejson
- name: Words spell checking
run: yarn spell:check:ci
- name: Format codebase
run: yarn format:ci
- name: Typecheck codebase
run: yarn ts:check
- name: Lint codebase
run: yarn lint:ci
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: eslint
path: reports/eslint
if-no-files-found: error
qa-unit-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Run unit and intergration specs
run: yarn test:unit:ci
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: jest
path: reports/jest
if-no-files-found: error
qa-mutation-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Run mutation specs
run: yarn test:mutation:ci
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: stryker
path: reports/stryker
if-no-files-found: error
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build
- name: Upload lib
uses: actions/upload-artifact@v3
with:
name: lib
path: lib
if-no-files-found: error
qa-sonar-cloud:
needs: [qa-lint, qa-unit-testing]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Download Eslint artifact
uses: actions/download-artifact@v3
with:
name: eslint
path: reports/eslint
- name: Download Jest artifact
uses: actions/download-artifact@v3
with:
name: jest
path: reports/jest
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
publish:
needs: [build, qa-lint, qa-unit-testing, qa-mutation-testing]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Download lib
uses: actions/download-artifact@v3
with:
name: lib
path: lib
- name: Semantic release
run: yarn semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}