CI: Split npm package smoke tests into a matrix

This commit is contained in:
Lovell Fuller 2023-10-11 08:41:46 +01:00
parent 6377d5a73a
commit 28a9b1e9fa

View File

@ -9,33 +9,84 @@ permissions: {}
jobs: jobs:
release-smoke-test: release-smoke-test:
name: "${{ github.ref }} ${{ matrix.name }}" name: "${{ github.ref_name }} ${{ matrix.name }}"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.runs-on }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- name: linux-x64 - name: linux-x64-node-npm
os: ubuntu-22.04 runs-on: ubuntu-22.04
- name: darwin-x64 runtime: node
os: macos-11 package-manager: npm
- name: win32-x64 - name: linux-x64-node-pnpm
os: windows-2019 runs-on: ubuntu-22.04
runtime: node
package-manager: pnpm
- name: linux-x64-node-yarn
runs-on: ubuntu-22.04
runtime: node
package-manager: yarn
- name: linux-x64-deno
runs-on: ubuntu-22.04
runtime: deno
- name: linux-x64-bun
runs-on: ubuntu-22.04
runtime: bun
- name: darwin-x64-node-npm
runs-on: macos-11
runtime: node
package-manager: npm
- name: darwin-x64-node-pnpm
runs-on: macos-11
runtime: node
package-manager: pnpm
- name: darwin-x64-node-yarn
runs-on: macos-11
runtime: node
package-manager: yarn
- name: darwin-x64-deno
runs-on: macos-11
runtime: deno
- name: darwin-x64-bun
runs-on: macos-11
runtime: bun
- name: win32-x64-node-npm
runs-on: windows-2019
runtime: node
package-manager: npm
- name: win32-x64-node-pnpm
runs-on: windows-2019
runtime: node
package-manager: pnpm
- name: win32-x64-node-yarn
runs-on: windows-2019
runtime: node
package-manager: yarn
- name: win32-x64-deno
runs-on: windows-2019
runtime: deno
steps: steps:
- name: Install Node.js - name: Install Node.js
if: ${{ matrix.runtime == 'node' }}
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 20 node-version: 20
- name: Install pnpm - name: Install pnpm
if: ${{ matrix.package-manager == 'pnpm' }}
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v2
with: with:
version: 8 version: 8
- name: Install Deno - name: Install Deno
if: ${{ matrix.runtime == 'deno' }}
uses: denoland/setup-deno@v1 uses: denoland/setup-deno@v1
with: with:
deno-version: v1.x deno-version: v1.x
- name: Install Bun - name: Install Bun
if: ${{ !contains(matrix.os, 'windows') }} if: ${{ matrix.runtime == 'bun' }}
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v1
with: with:
bun-version: latest bun-version: latest
@ -68,33 +119,34 @@ jobs:
deepStrictEqual(['.jpg', '.jpeg', '.jpe'], sharp.format.jpeg.input.fileSuffix); deepStrictEqual(['.jpg', '.jpeg', '.jpe'], sharp.format.jpeg.input.fileSuffix);
- name: Run with Node.js + npm - name: Run with Node.js + npm
if: ${{ matrix.runtime == 'node' && matrix.package-manager == 'npm' }}
run: | run: |
npm install --ignore-scripts npm install --ignore-scripts
node release.mjs node release.mjs
rm -r node_modules/ package-lock.json
- name: Run with Node.js + pnpm - name: Run with Node.js + pnpm
if: ${{ matrix.runtime == 'node' && matrix.package-manager == 'pnpm' }}
run: | run: |
pnpm install --ignore-scripts pnpm install --ignore-scripts
node release.mjs node release.mjs
rm -r node_modules/ pnpm-lock.yaml
- name: Run with Node.js + yarn - name: Run with Node.js + yarn
if: ${{ matrix.runtime == 'node' && matrix.package-manager == 'yarn' }}
run: | run: |
corepack enable corepack enable
yarn set version stable yarn set version stable
yarn config set enableImmutableInstalls false
yarn config set enableScripts false yarn config set enableScripts false
yarn config set nodeLinker node-modules yarn config set nodeLinker node-modules
yarn install yarn install
node release.mjs node release.mjs
rm -r node_modules/ .yarn/ yarn.lock .yarnrc.yml
corepack disable
- name: Run with Deno - name: Run with Deno
if: ${{ matrix.runtime == 'deno' }}
run: deno run --allow-read --allow-ffi release.mjs run: deno run --allow-read --allow-ffi release.mjs
- name: Run with Bun - name: Run with Bun
if: ${{ !contains(matrix.os, 'windows') }} if: ${{ matrix.runtime == 'bun' }}
run: | run: |
bun install --ignore-scripts bun install --ignore-scripts
bun release.mjs bun release.mjs