-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(structure): consolidated all verification under the
test
script
while also enabling isolated execution. similar to semantic-release/semantic-release#2964 for semantic-release/.github#19
- Loading branch information
Showing
4 changed files
with
8,849 additions
and
1,990 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ name: Test | |
- opened | ||
- synchronize | ||
jobs: | ||
# verify against ranges defined as supported in engines.node | ||
test_matrix: | ||
strategy: | ||
matrix: | ||
|
@@ -27,21 +28,39 @@ jobs: | |
node-version: "${{ matrix.node-version }}" | ||
cache: npm | ||
- run: npm clean-install | ||
- run: npm audit signatures | ||
- run: npm test | ||
test: | ||
|
||
# verify against the node version defined for development in the .nvmrc | ||
test_dev: | ||
runs-on: ubuntu-latest | ||
needs: test_matrix | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 | ||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | ||
- run: git config --global user.name github-actions | ||
- run: git config --global user.email [email protected] | ||
- name: Use Node.js from .nvmrc | ||
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 | ||
with: | ||
node-version: "lts/*" | ||
node-version-file: .nvmrc | ||
cache: npm | ||
- run: npm clean-install | ||
- run: npm audit signatures | ||
- name: Ensure dependencies are compatible with the version of node | ||
run: npx ls-engines | ||
- run: npm run lint | ||
# https://github.com/lirantal/lockfile-lint#readme | ||
- name: Scan lockfile for security issues | ||
run: npx lockfile-lint --path package-lock.json | ||
- run: npm test | ||
|
||
# separate job to set as required in branch protection, | ||
# as the build names above change each time Node versions change | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test_dev | ||
- test_matrix | ||
if: always() | ||
steps: | ||
- name: All matrix versions passed | ||
if: ${{ !(contains(needs.*.result, 'failure')) }} | ||
run: exit 0 | ||
- name: Some matrix version failed | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v18 |
Oops, something went wrong.