Skip to content

Commit 801ed66

Browse files
committed
[Tests] rework CI
1 parent 3683d81 commit 801ed66

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
name: CI
2-
on: [push]
2+
3+
on: [pull_request, push]
4+
5+
permissions:
6+
contents: read
7+
38
jobs:
4-
build:
5-
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
node: ['12', '13', '14', '15', '16', '17', '18']
9-
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-node@v2
12-
with:
13-
node-version: ${{ matrix.node }}
14-
check-latest: true
15-
- run: npm install
16-
- run: npm test
17-
env:
18-
CI: true
19-
- run: npm run lint
20-
- run: npm run licenses
9+
tests:
10+
uses: ljharb/actions/.github/workflows/node-majors.yml@main
11+
with:
12+
range: '>= 14.17'
13+
command: 'npm run tests-only && npm run licenses'

.github/workflows/pretest.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: 'Tests: pretest/posttest'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
tests:
7+
uses: ljharb/actions/.github/workflows/pretest.yml@main

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"licensee"
3030
],
3131
"devDependencies": {
32+
"aud": "^2.0.1",
3233
"rimraf": "^3.0.2",
3334
"run-parallel": "^1.2.0",
3435
"spawn-sync": "^2.0.0",
@@ -40,7 +41,10 @@
4041
"scripts": {
4142
"licenses": "./licensee --errors-only",
4243
"lint": "standard index.js licensee test/**/test.js",
43-
"test": "tap --no-check-coverage tests/unit.test.js tests/**/test.js"
44+
"pretest": "npm run lint",
45+
"tests-only": "tap --no-check-coverage tests/unit.test.js tests/**/test.js",
46+
"test": "npm run tests-only",
47+
"posttest": "aud --production"
4448
},
4549
"engines": {
4650
"node": ">= 14.17"

0 commit comments

Comments
 (0)