ci: setup pnpm before running tests #401
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
on: | ||
workflow_call: | ||
inputs: | ||
disable-windows: | ||
description: Disable running tests on Windows | ||
type: boolean | ||
default: false | ||
required: false | ||
inputs: | ||
install-pnpm: | ||
description: Install pnpm before running tests | ||
type: boolean | ||
default: false | ||
required: false | ||
jobs: | ||
test_linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.16.0, 20.x] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install pnpm | ||
if: ${{ inputs.install-pnpm }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.6.3 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm test | ||
test_windows: | ||
if: ${{ !inputs.disable-windows }} | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.16.0, 20.x] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install pnpm | ||
if: ${{ inputs.install-pnpm }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.6.3 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm test |