test: migrate to vitest #1082
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: Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
YARN_ENABLE_GLOBAL_CACHE: false | |
jobs: | |
chore: | |
name: "Testing chores" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Get the Yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/cache@v4 | |
with: | |
path: ${{steps.yarn-cache-dir-path.outputs.dir}} | |
key: ${{runner.os}}-yarn-${{hashFiles('**/yarn.lock')}} | |
restore-keys: | | |
${{runner.os}}-yarn- | |
- run: corepack yarn install --immutable | |
- name: "Check for type errors" | |
run: corepack yarn typecheck | |
- name: "Check for linting errors" | |
run: corepack yarn lint | |
build-and-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
node: | |
- 18 | |
- 20 | |
- 21 | |
- 22 | |
platform: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
name: "${{matrix.platform}} w/ Node.js ${{matrix.node}}.x" | |
runs-on: ${{matrix.platform}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Use Node.js ${{matrix.node}}.x" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node}}.x | |
- name: Get the Yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/cache@v4 | |
with: | |
path: ${{steps.yarn-cache-dir-path.outputs.dir}} | |
key: ${{runner.os}}-yarn-${{hashFiles('**/yarn.lock')}} | |
restore-keys: | | |
${{runner.os}}-yarn- | |
- run: corepack yarn install --immutable | |
- run: corepack yarn build # We need the stubs to run the tests | |
- run: corepack yarn test | |
env: | |
NOCK_ENV: replay |