@@ -3,105 +3,114 @@ name: Test and Release
33# Run this job on all pushes and pull requests
44# as well as tags with a semantic version
55on :
6- push :
7- branches :
8- - " *"
9- tags :
10- # normal versions
11- - " v[0-9]+.[0-9]+.[0-9]+"
12- # pre-releases
13- - " v[0-9]+.[0-9]+.[0-9]+-**"
14- pull_request : {}
6+ push :
7+ branches :
8+ - " *"
9+ tags :
10+ # normal versions
11+ - " v[0-9]+.[0-9]+.[0-9]+"
12+ # pre-releases
13+ - " v[0-9]+.[0-9]+.[0-9]+-**"
14+ pull_request : {}
1515
1616jobs :
17- # Performs quick checks before the expensive test runs
18- check-and-lint :
19- if : contains(github.event.head_commit.message, '[skip ci]') == false
20-
21- runs-on : ubuntu-latest
22- strategy :
23- matrix :
24- node-version : [14.x]
25-
26- steps :
27- - uses : actions/checkout@v1
28- - name : Use Node.js ${{ matrix.node-version }}
29- uses : actions/setup-node@v1
30- with :
31- node-version : ${{ matrix.node-version }}
32-
33- - name : Install dependencies
34- run : npm ci
35-
36- - name : Perform a type check
37- run : npm run check
38- env :
39- CI : true
40-
41- - name : Lint TypeScript code
42- run : npm run lint
43-
44- # ===================
45-
46- # Runs unit tests on all supported node versions and OSes
47- unit-tests :
48- if : contains(github.event.head_commit.message, '[skip ci]') == false
49-
50- needs : [check-and-lint]
51-
52- runs-on : ${{ matrix.os }}
53- strategy :
54- matrix :
55- node-version : [12.x, 14.x, 16.x]
56- os : [ubuntu-latest]
57-
58- steps :
59- - uses : actions/checkout@v1
60- - name : Use Node.js ${{ matrix.node-version }}
61- uses : actions/setup-node@v1
62- with :
63- node-version : ${{ matrix.node-version }}
64-
65- - name : Install dependencies
66- run : npm ci
67-
68- - name : Run component tests
69- run : npm run test
70- env :
71- CI : true
72-
73- # ===================
74-
75- # Deploys the final package to NPM
76- deploy :
77- # Trigger this step only when a commit on master is tagged with a version number
78- if : |
79- contains(github.event.head_commit.message, '[skip ci]') == false &&
80- github.event_name == 'push' &&
81- startsWith(github.ref, 'refs/tags/v')
82-
83- needs : [unit-tests]
84-
85- runs-on : ubuntu-latest
86- strategy :
87- matrix :
88- node-version : [14.x]
89-
90- steps :
91- - uses : actions/checkout@v1
92- - name : Use Node.js ${{ matrix.node-version }}
93- uses : actions/setup-node@v1
94- with :
95- node-version : ${{ matrix.node-version }}
96-
97- - name : Install dependencies
98- run : npm ci
99-
100- - name : Create a clean build
101- run : npm run build
102-
103- - name : Publish package to npm
104- run : |
105- npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
106- npm whoami
107- npm publish
17+ # Performs quick checks before the expensive test runs
18+ check-and-lint :
19+ if : contains(github.event.head_commit.message, '[skip ci]') == false
20+
21+ runs-on : ubuntu-latest
22+ strategy :
23+ matrix :
24+ node-version : [16.x] # This should be LTS
25+
26+ steps :
27+ - name : Checkout code
28+ uses : actions/checkout@v3
29+
30+ - name : Use Node.js ${{ matrix.node-version }}
31+ uses : actions/setup-node@v3
32+ with :
33+ node-version : ${{ matrix.node-version }}
34+ cache : " npm"
35+
36+ - name : Install dependencies
37+ run : npm ci
38+
39+ - name : Perform a type check
40+ run : npm run check
41+ env :
42+ CI : true
43+
44+ - name : Lint TypeScript code
45+ run : npm run lint
46+
47+ # ===================
48+
49+ # Runs unit tests on all supported node versions and OSes
50+ unit-tests :
51+ if : contains(github.event.head_commit.message, '[skip ci]') == false
52+
53+ needs : [check-and-lint]
54+
55+ runs-on : ${{ matrix.os }}
56+ strategy :
57+ matrix :
58+ node-version : [14.x, 16.x, 18.x]
59+ os : [ubuntu-latest]
60+
61+ steps :
62+ - name : Checkout code
63+ uses : actions/checkout@v3
64+
65+ - name : Use Node.js ${{ matrix.node-version }}
66+ uses : actions/setup-node@v3
67+ with :
68+ node-version : ${{ matrix.node-version }}
69+ cache : " npm"
70+
71+ - name : Install dependencies
72+ run : npm ci
73+
74+ - name : Run component tests
75+ run : npm run test
76+ env :
77+ CI : true
78+
79+ # ===================
80+
81+ # Deploys the final package to NPM
82+ deploy :
83+ # Trigger this step only when a commit on master is tagged with a version number
84+ if : |
85+ contains(github.event.head_commit.message, '[skip ci]') == false &&
86+ github.event_name == 'push' &&
87+ startsWith(github.ref, 'refs/tags/v')
88+
89+ needs : [unit-tests]
90+
91+ runs-on : ubuntu-latest
92+ strategy :
93+ matrix :
94+ node-version : [16.x] # This should be LTS
95+
96+ steps :
97+ - name : Checkout code
98+ uses : actions/checkout@v3
99+
100+ - name : Use Node.js ${{ matrix.node-version }}
101+ uses : actions/setup-node@v3
102+ with :
103+ node-version : ${{ matrix.node-version }}
104+ cache : " npm"
105+
106+ - name : Install dependencies
107+ run : npm ci
108+
109+ - name : Create a clean build
110+ run : npm run build
111+
112+ - name : Publish package to npm
113+ run : |
114+ npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
115+ npm whoami
116+ npm publish
0 commit comments