Skip to content

Commit

Permalink
ci: cleanup action versions and caching
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Mar 27, 2023
1 parent 6eef540 commit c40c8af
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
66 changes: 35 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,43 @@ name: CI

on: [push, pull_request]

jobs:
ci:
env:
HUSKY: 0

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]

node-version:
- 12
- 14
- 16
- 18
- 19
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Use Node.js 16.x to build
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm install
- run: npm run build
- run: rm -rf node_modules
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
env:
CI: true
- run: npm run lint
if: matrix.node-version == '16.x'
- run: npm run docs:diff
if: matrix.node-version == '16.x'
- run: npm run test:node
if: matrix.node-version >= '16.x'
- run: npm run test:pack
if: matrix.node-version >= '16.x'
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run test
- run: npm run docs:diff
if: matrix.node-version == 16
- run: npm run test:node
if: matrix.node-version >= 16
- run: npm run test:pack
if: matrix.node-version >= 16
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
"examples:node:jest:test": "cd examples/node-jest && npm install && npm test",
"prepare": "cd $( git rev-parse --show-toplevel ) && husky install",
"prepare": "husky install",
"lint": "npm run eslint:check && npm run prettier:check",
"eslint:check": "eslint src/ test/ examples/ *.js",
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
"pretest": "[ -n $CI ] || npm run build",
"pretest": "npm run build",
"test": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/",
"pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**",
"test:browser": "wdio run ./wdio.conf.js",
Expand All @@ -109,7 +109,7 @@
"prettier:fix": "prettier --write '**/*.{js,jsx,json,md}'",
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
"md": "runmd --watch --output=README.md README_js.md",
"docs": "( node --version | grep -q 'v16' ) && ( npm run build && npx runmd --output=README.md README_js.md )",
"docs": "npm run build && npx runmd --output=README.md README_js.md",
"docs:diff": "npm run docs && git diff --quiet README.md",
"build": "./scripts/build.sh",
"prepack": "npm run build",
Expand Down

0 comments on commit c40c8af

Please sign in to comment.