Skip to content

Commit

Permalink
Merge branch 'main' into update_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Jun 3, 2024
2 parents 1e94ac5 + 1faad97 commit a2b61c6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request_target:
types: [labeled]

env:
HUSKY: 0

jobs:
browser:
if: github.repository == 'uuidjs/uuid' && (contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push')
Expand All @@ -16,7 +19,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 @@ -88,11 +88,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 @@ -106,7 +106,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 a2b61c6

Please sign in to comment.