Skip to content

Commit 03915ac

Browse files
committed
ci(node): add node actions for testing
Signed-off-by: Jayne Doe <[email protected]>
1 parent 7a64d7f commit 03915ac

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: NodeJS build and test
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [12.x, 14.x, 16.x]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Build
22+
run: |
23+
npm install
24+
npm run build
25+
26+
- name: Upload public build artefacts
27+
uses: actions/[email protected]
28+
with:
29+
# Artifact name
30+
name: npm-gulp-build-files-public
31+
# A file, directory or wildcard pattern that describes what to upload
32+
path: public
33+
# The desired behavior if no files are found using the provided path.
34+
if-no-files-found: error
35+
retention-days: 1
36+
- name: Upload TS build artefacts
37+
uses: actions/[email protected]
38+
with:
39+
# Artifact name
40+
name: npm-gulp-build-files-ts
41+
# A file, directory or wildcard pattern that describes what to upload
42+
path: src/js
43+
# The desired behavior if no files are found using the provided path.
44+
if-no-files-found: error
45+
retention-days: 1
46+
47+
lint:
48+
runs-on: ubuntu-latest
49+
50+
needs: build
51+
continue-on-error: true
52+
53+
strategy:
54+
matrix:
55+
node-version: [12.x, 14.x, 16.x]
56+
57+
steps:
58+
- uses: actions/checkout@v2
59+
60+
- name: Download public build artefacts
61+
uses: actions/[email protected]
62+
with:
63+
# Artifact name
64+
name: npm-gulp-build-files-public
65+
# Destination path
66+
path: public
67+
- name: Download TS build artefacts
68+
uses: actions/[email protected]
69+
with:
70+
# Artifact name
71+
name: npm-gulp-build-files-ts
72+
# Destination path
73+
path: src/js
74+
75+
- name: Use Node.js ${{ matrix.node-version }}
76+
uses: actions/setup-node@v1
77+
with:
78+
node-version: ${{ matrix.node-version }}
79+
80+
- name: Perform lint checks
81+
run: |
82+
npm i
83+
npm run quality:eslint
84+
85+
test:
86+
runs-on: ubuntu-latest
87+
88+
needs: build
89+
90+
strategy:
91+
matrix:
92+
node-version: [12.x, 14.x, 16.x]
93+
94+
steps:
95+
- uses: actions/checkout@v2
96+
97+
- name: Download public build artefacts
98+
uses: actions/[email protected]
99+
with:
100+
# Artifact name
101+
name: npm-gulp-build-files-public
102+
# Destination path
103+
path: public
104+
- name: Download TS build artefacts
105+
uses: actions/[email protected]
106+
with:
107+
# Artifact name
108+
name: npm-gulp-build-files-ts
109+
# Destination path
110+
path: src/js
111+
112+
- name: Use Node.js ${{ matrix.node-version }}
113+
uses: actions/setup-node@v1
114+
with:
115+
node-version: ${{ matrix.node-version }}
116+
117+
- name: Perform tests
118+
run: |
119+
npm i
120+
npm run generate-certs
121+
npm run test:unit

0 commit comments

Comments
 (0)