make project a variable. try to use inputs on job names

This commit is contained in:
flx-sta 2024-09-10 13:44:44 -07:00
parent 99e6b4034f
commit 94e2a92ef9
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,9 @@ name: Test Template
on:
workflow_call:
inputs:
project:
required: true
type: string
shard:
required: true
type: number
@ -12,6 +15,7 @@ on:
jobs:
test:
name: Test ${{ inputs.shard }}/${{ inputs.totalShards }} in project "${{ inputs.project }}"
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
@ -23,4 +27,4 @@ jobs:
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
run: npx vitest --project main --shard=${{ inputs.shard }}/${{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }}
run: npx vitest --project ${{ inputs.project }} --shard=${{ inputs.shard }}/${{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }}

View File

@ -42,5 +42,6 @@ jobs:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
uses: ./.github/workflows/test-shard-template.yml
with:
project: main
shard: ${{ matrix.shard }}
totalShards: 10