Skip to content

Commit

Permalink
ci: cleanup action versions and caching (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Jun 3, 2024
1 parent 883b163 commit 2cc6c93
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 10
- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,40 @@ name: CI

on: [push, pull_request]

env:
HUSKY: 0

jobs:
ci:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm run lint

test:
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Use Node.js 20.x to build
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: npm install
- run: npm run build
- run: rm -rf node_modules
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
cache: npm
- run: npm ci
- run: npm run test
env:
CI: true
- run: npm run lint
if: matrix.node-version == '20.x'
- run: npm run docs:diff
if: matrix.node-version == '20.x'
if: matrix.node-version == 20
- run: npm run test:node
if: matrix.node-version >= '20.x'
if: matrix.node-version >= 20
- run: npm run test:pack
if: matrix.node-version >= '20.x'
if: matrix.node-version >= 20
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/",
"test:matching": "BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t",
"pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**",
Expand All @@ -110,7 +110,7 @@
"prettier:fix": "prettier --write .",
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
"md": "runmd --watch --output=README.md README_js.md",
"docs": "( node --version | grep -q 'v20' ) && ( 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 2cc6c93

Please sign in to comment.