13
13
- cron : " 25 12 * * 1"
14
14
15
15
jobs :
16
- lint :
17
- name : Lint
18
- runs-on : ubuntu-latest
19
- timeout-minutes : 10
20
-
21
- steps :
22
- - name : Checkout source
23
- uses : actions/checkout@v3
24
-
25
- - name : Install Node.js and dependencies
26
- uses : ./.github/actions/setup
27
-
28
- - name : Run linters
29
- run : npm run lint
30
-
31
16
test :
32
- name : Run tests using Node ${{ matrix.node }} on ${{ matrix.os }}
17
+ name : Unit tests / Node.js ${{ matrix.node-version }} / ${{ matrix.os }}
33
18
runs-on : ${{ matrix.os }}
34
19
timeout-minutes : 10
35
20
strategy :
38
23
os :
39
24
- ubuntu-latest
40
25
- macos-latest
41
- # TODO(mc, 2023-04-07): investigate and fix coverage-related failures on Windows
42
- # - windows-latest
43
- node :
26
+ - windows-latest
27
+ node-version :
44
28
- 16
45
29
- 18
46
30
51
35
- name : Install Node.js ${{ matrix.node }} and dependencies
52
36
uses : ./.github/actions/setup
53
37
with :
54
- node-version : ${{ matrix.node }}
55
-
56
- - name : Build the code
57
- run : npm run build
38
+ node-version : ${{ matrix.node-version }}
58
39
59
40
- name : Run tests
60
41
run : npm run coverage
78
59
parallel-finished : true
79
60
80
61
build :
81
- name : Build
62
+ name : Build and lint
82
63
runs-on : ubuntu-latest
83
64
timeout-minutes : 10
84
65
@@ -92,18 +73,33 @@ jobs:
92
73
- name : Build
93
74
run : npm run build
94
75
76
+ - name : Verify no un-staged changes
77
+ run : |
78
+ git status --porcelain
79
+ git diff-files --quiet
80
+
81
+ - name : Run lints
82
+ run : npm run lint
83
+
95
84
- name : Upload publish artifact
96
85
uses : actions/upload-artifact@v3
97
86
with :
98
87
name : publish-artifact
99
88
path : lib
100
89
101
90
e2e :
102
- name : Run end-to-end tests
91
+ name : E2E tests / Node.js ${{ matrix.node-version }}
103
92
runs-on : ubuntu-latest
104
93
timeout-minutes : 10
105
94
needs : build
106
95
96
+ strategy :
97
+ fail-fast : false
98
+ matrix :
99
+ node-version :
100
+ - 16
101
+ - 18
102
+
107
103
services :
108
104
verdaccio :
109
105
image : verdaccio/verdaccio:5
@@ -117,6 +113,7 @@ jobs:
117
113
- name : Install Node.js and dependencies
118
114
uses : ./.github/actions/setup
119
115
with :
116
+ node-version : ${{ matrix.node-version }}
120
117
install-command : npm install --production
121
118
122
119
- name : Download publish artifact
@@ -130,20 +127,20 @@ jobs:
130
127
shell : bash
131
128
run : |
132
129
echo "token=$(./e2e/00-login.sh)" >> "$GITHUB_OUTPUT"
133
- echo "package=$(./e2e/01-setup-package.sh ./e2e/fixture 0.0.1)" >> "$GITHUB_OUTPUT"
130
+ echo "package=$(./e2e/01-setup-package.sh ./e2e/fixture/cool\ package 0.0.1)" >> "$GITHUB_OUTPUT"
134
131
135
132
- name : Run CLI end-to-end test
136
133
shell : bash
137
134
env :
138
135
TOKEN : ${{ steps.setup.outputs.token }}
139
136
PACKAGE : ${{ steps.setup.outputs.package }}
140
137
run : |
141
- ./e2e/02-publish.sh ${PACKAGE} ${TOKEN}
142
- ./e2e/03-verify.sh ${PACKAGE}
143
- ./e2e/02-publish.sh ${PACKAGE} ${TOKEN}
144
- ./e2e/01-setup-package.sh ${PACKAGE} 0.0.2
145
- ./e2e/02-publish.sh ${PACKAGE} ${TOKEN}
146
- ./e2e/03-verify.sh ${PACKAGE}
138
+ ./e2e/02-publish.sh " ${PACKAGE}" ${TOKEN}
139
+ ./e2e/03-verify.sh " ${PACKAGE}"
140
+ ./e2e/02-publish.sh " ${PACKAGE}" ${TOKEN}
141
+ ./e2e/01-setup-package.sh " ${PACKAGE}" 0.0.2
142
+ ./e2e/02-publish.sh " ${PACKAGE}" ${TOKEN}
143
+ ./e2e/03-verify.sh " ${PACKAGE}"
147
144
148
145
- id : action-no-publish
149
146
name : Publish with already published version
@@ -154,14 +151,14 @@ jobs:
154
151
token : ${{ steps.setup.outputs.token }}
155
152
156
153
- name : Check action output
157
- if : ${{ steps.action-no-publish.outputs.type != 'none' }}
154
+ if : ${{ steps.action-no-publish.outputs.type }}
158
155
run : |
159
- echo "::error::Expected release type to be 'none ', got '${{ steps.action-no-publish.outputs.type }}'"
156
+ echo "::error::Expected release type to be '', got '${{ steps.action-no-publish.outputs.type }}'"
160
157
exit 1
161
158
162
159
- name : Create new version for Action end-to-end test
163
160
shell : bash
164
- run : ./e2e/01-setup-package.sh ${{ steps.setup.outputs.package }} 0.0.3
161
+ run : ./e2e/01-setup-package.sh " ${{ steps.setup.outputs.package }}" 0.0.3
165
162
166
163
- id : action-publish
167
164
name : Publish a new version
@@ -179,11 +176,10 @@ jobs:
179
176
180
177
deploy :
181
178
if : ${{ github.ref == 'refs/heads/main' }}
182
- name : Publish to NPM
179
+ name : Publish
183
180
runs-on : ubuntu-latest
184
181
timeout-minutes : 10
185
182
needs :
186
- - lint
187
183
- test
188
184
- build
189
185
- e2e
0 commit comments