chore: refactor ci to use corepack and package manager via matrix #39
Workflow file for this run
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
name: CI | |
env: | |
# configure corepack | |
COREPACK_DEFAULT_TO_LATEST: 0 | |
COREPACK_ENABLE_AUTO_PIN: 0 | |
# configure yarn | |
YARN_ENABLE_IMMUTABLE_INSTALLS: 'false' | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
jobs: | |
test: | |
name: Test | |
timeout-minutes: 5 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [20] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
pm: ["pnpm@9"] | |
include: | |
- node: 22 | |
os: ubuntu-latest | |
pm: "pnpm@9" | |
- node: 22 | |
os: ubuntu-latest | |
pm: "yarn@4" | |
- node: 22 | |
os: ubuntu-latest | |
pm: "npm@10" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: corepack enable | |
- name: Install dependencies | |
run: corepack ${{matrix.pm}} install | |
- name: Test | |
run: corepack ${{matrix.pm}} test |