chore(deps): update all non-major dependencies #374
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build and test on linux, windows, mac with node 14, 16, 18 | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# "checks" job runs on linux + node16 only and checks that install, build, lint, format work | |
# it also primes the pnpm store cache for linux, important for downstream tests | |
checks: | |
timeout-minutes: 5 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# pseudo-matrix for convenience, NEVER use more than a single combination | |
node: [16] | |
os: [ubuntu-latest] | |
outputs: | |
build_successful: ${{ steps.build.outcome == 'success' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: install pnpm | |
shell: bash | |
run: | | |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json) | |
echo installing pnpm version $PNPM_VER | |
npm i -g pnpm@$PNPM_VER | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
cache-dependency-path: '**/pnpm-lock.yaml' | |
- name: install | |
run: | | |
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | |
node node_modules/esbuild/install.js | |
- name: build | |
id: build | |
run: pnpm build | |
- name: lint | |
if: (${{ success() }} || ${{ failure() }}) | |
run: pnpm lint | |
- name: format | |
if: (${{ success() }} || ${{ failure() }}) | |
run: pnpm format | |
# this is the test matrix, it runs with node16 on linux,windows,macos + node14,18 on linux | |
# it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail) | |
test: | |
needs: checks | |
if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }}) | |
timeout-minutes: 10 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [16] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- node: 14 | |
os: ubuntu-latest | |
- node: 18 | |
os: ubuntu-latest | |
- node: 20 | |
os: ubuntu-latest | |
steps: | |
- run: git config --global core.autocrlf false # prevent crlf on windows | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: install pnpm | |
if: matrix.node != 14 | |
shell: bash | |
run: | | |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json) | |
echo installing pnpm version $PNPM_VER | |
npm i -g pnpm@$PNPM_VER | |
- name: install legacy pnpm for node14 | |
if: matrix.node == 14 | |
run: | | |
npm i -g pnpm@^7.32.0 | |
tmppkg="$(jq '.engines.pnpm = "^7.32.0"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg="" | |
sed -i 's/engine-strict=true/engine-strict=false/' .npmrc | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
cache-dependency-path: '**/pnpm-lock.yaml' | |
- name: install | |
run: | | |
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | |
node node_modules/esbuild/install.js | |
- name: build | |
run: pnpm build:ci | |
- name: run tests | |
run: pnpm test | |