Skip to content

Commit

Permalink
[Tests] rework CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 16, 2022
1 parent 3683d81 commit 801ed66
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
name: CI
on: [push]

on: [pull_request, push]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['12', '13', '14', '15', '16', '17', '18']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
check-latest: true
- run: npm install
- run: npm test
env:
CI: true
- run: npm run lint
- run: npm run licenses
tests:
uses: ljharb/actions/.github/workflows/node-majors.yml@main
with:
range: '>= 14.17'
command: 'npm run tests-only && npm run licenses'
7 changes: 7 additions & 0 deletions .github/workflows/pretest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: 'Tests: pretest/posttest'

on: [pull_request, push]

jobs:
tests:
uses: ljharb/actions/.github/workflows/pretest.yml@main
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"licensee"
],
"devDependencies": {
"aud": "^2.0.1",
"rimraf": "^3.0.2",
"run-parallel": "^1.2.0",
"spawn-sync": "^2.0.0",
Expand All @@ -40,7 +41,10 @@
"scripts": {
"licenses": "./licensee --errors-only",
"lint": "standard index.js licensee test/**/test.js",
"test": "tap --no-check-coverage tests/unit.test.js tests/**/test.js"
"pretest": "npm run lint",
"tests-only": "tap --no-check-coverage tests/unit.test.js tests/**/test.js",
"test": "npm run tests-only",
"posttest": "aud --production"
},
"engines": {
"node": ">= 14.17"
Expand Down

0 comments on commit 801ed66

Please sign in to comment.