Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: cleanup action versions and caching #707

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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:
fail-fast: false
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]

node-version:
- 12
- 14
- 16
- 18
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