pokerogue/.github/workflows/test-shard-template.yml
2025-12-07 13:59:20 -06:00

45 lines
1.3 KiB
YAML

name: Test Template
on:
workflow_call:
inputs:
shard:
required: true
type: number
totalShards:
required: true
type: number
jobs:
test:
# We can't use dynamically named jobs until https://github.com/orgs/community/discussions/13261 is implemented
name: Shard
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: ./.github/actions/setup-deps
- name: Run tests
run: >
pnpm test:silent
--shard=${{ inputs.shard }}/${{ inputs.totalShards }}
--reporter=blob
--outputFile=test-results/blob-${{ inputs.shard }}.json || true
# NB: This CANNOT be made into a job output due to not being extractable from the matrix:
# https://github.com/orgs/community/discussions/17245
- name: Upload test result blobs
uses: actions/upload-artifact@v4
with:
name: shard-${{ inputs.shard }}-blob
path: test-results/blob-${{ inputs.shard }}.json
retention-days: 1 # don't need to keep for very long since they get merged afterwards
overwrite: true
if-no-files-found: error
if: ${{ !cancelled() }}