Skip to content

chore: refactor ci to use corepack and package manager via matrix #37

chore: refactor ci to use corepack and package manager via matrix

chore: refactor ci to use corepack and package manager via matrix #37

Workflow file for this run

name: CI
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
# configure corepack
COREPACK_DEFAULT_TO_LATEST: 0
COREPACK_ENABLE_AUTO_PIN: 0
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 }}
- name: create yarn lock
if: startsWith(${{matrix.pm}},'yarn')
run: touch yarn.lock
- run: corepack enable
- name: Install dependencies
run: corepack ${{matrix.pm}} install
- name: Test
run: corepack ${{matrix.pm}} test