1313 - cron : " 25 12 * * 1"
1414
1515jobs :
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-
3116 test :
32- name : Run tests using Node ${{ matrix.node }} on ${{ matrix.os }}
17+ name : Unit tests / Node.js ${{ matrix.node-version }} / ${{ matrix.os }}
3318 runs-on : ${{ matrix.os }}
3419 timeout-minutes : 10
3520 strategy :
3823 os :
3924 - ubuntu-latest
4025 - 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 :
4428 - 16
4529 - 18
4630
5135 - name : Install Node.js ${{ matrix.node }} and dependencies
5236 uses : ./.github/actions/setup
5337 with :
54- node-version : ${{ matrix.node }}
55-
56- - name : Build the code
57- run : npm run build
38+ node-version : ${{ matrix.node-version }}
5839
5940 - name : Run tests
6041 run : npm run coverage
7859 parallel-finished : true
7960
8061 build :
81- name : Build
62+ name : Build and lint
8263 runs-on : ubuntu-latest
8364 timeout-minutes : 10
8465
@@ -92,18 +73,33 @@ jobs:
9273 - name : Build
9374 run : npm run build
9475
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+
9584 - name : Upload publish artifact
9685 uses : actions/upload-artifact@v3
9786 with :
9887 name : publish-artifact
9988 path : lib
10089
10190 e2e :
102- name : Run end-to-end tests
91+ name : E2E tests / Node.js ${{ matrix.node-version }}
10392 runs-on : ubuntu-latest
10493 timeout-minutes : 10
10594 needs : build
10695
96+ strategy :
97+ fail-fast : false
98+ matrix :
99+ node-version :
100+ - 16
101+ - 18
102+
107103 services :
108104 verdaccio :
109105 image : verdaccio/verdaccio:5
@@ -117,6 +113,7 @@ jobs:
117113 - name : Install Node.js and dependencies
118114 uses : ./.github/actions/setup
119115 with :
116+ node-version : ${{ matrix.node-version }}
120117 install-command : npm install --production
121118
122119 - name : Download publish artifact
@@ -130,20 +127,20 @@ jobs:
130127 shell : bash
131128 run : |
132129 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"
134131
135132 - name : Run CLI end-to-end test
136133 shell : bash
137134 env :
138135 TOKEN : ${{ steps.setup.outputs.token }}
139136 PACKAGE : ${{ steps.setup.outputs.package }}
140137 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}"
147144
148145 - id : action-no-publish
149146 name : Publish with already published version
@@ -154,14 +151,14 @@ jobs:
154151 token : ${{ steps.setup.outputs.token }}
155152
156153 - name : Check action output
157- if : ${{ steps.action-no-publish.outputs.type != 'none' }}
154+ if : ${{ steps.action-no-publish.outputs.type }}
158155 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 }}'"
160157 exit 1
161158
162159 - name : Create new version for Action end-to-end test
163160 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
165162
166163 - id : action-publish
167164 name : Publish a new version
@@ -179,11 +176,10 @@ jobs:
179176
180177 deploy :
181178 if : ${{ github.ref == 'refs/heads/main' }}
182- name : Publish to NPM
179+ name : Publish
183180 runs-on : ubuntu-latest
184181 timeout-minutes : 10
185182 needs :
186- - lint
187183 - test
188184 - build
189185 - e2e
0 commit comments