Skip to content

Fix tests installation #3

Fix tests installation

Fix tests installation #3

Workflow file for this run

name: test
on:
push:
branches: [ main ]
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches: [ main ]
jobs:
test:
name: Tests
runs-on: ubuntu-22.04
strategy:
matrix:
node_version: [ 20.11.0, 21.5.0 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8.14.0
run_install: false
- name: Get pnpm store directory
id: pnpm_info
shell: bash
run: echo "store_path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm_info.outputs.store_path }}
key: ${{ runner.os }}-node${{ matrix.node_version }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node${{ matrix.node_version }}-pnpm-store-
- name: Install dependencies
run: |
pnpm install --recursive --strict-peer-dependencies --frozen-lockfile
cd examples
pnpm link ../niivue-react
- name: Unit tests
run: |
cd niivue-react
pnpm test
- name: Install Playwright Browsers
run: |
cd niivue-react
pnpm exec playwright install --with-deps
- name: Integration tests
run: |
cd niivue-react
pnpm test:playwright