adopt shards workflow in vitest

This commit is contained in:
flx-sta 2024-09-10 13:33:26 -07:00
parent f619dbf0d2
commit 1083ee56fe
2 changed files with 30 additions and 8 deletions

View File

@ -0,0 +1,26 @@
name: Test Template
on:
workflow_call:
inputs:
shard:
required: true
type: number
totalShards:
required: true
type: number
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
run: npx vitest --project main --shard={{ inputs.shard }}/{{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }}

View File

@ -35,16 +35,12 @@ jobs:
run: npx vitest run --project pre ${{ !runner.debug && '--silent' || '' }}
run-tests:
name: Run Tests
name: Run Tests
needs: [pre-test]
strategy:
matrix:
project:
# - misc
- "src/test/abilities/**/*.{test,spec}.ts"
# - items
# - moves
# - battle
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
uses: ./.github/workflows/run-test-template.yml
with:
project: ${{ matrix.project }}
shard: ${{ matrix.shard }}
totalShards: 10