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: on:
workflow_call: workflow_call:
inputs: inputs:
project:
required: true
type: string
shard: shard:
required: true required: true
type: number type: number
@ -12,6 +15,7 @@ on:
jobs: jobs:
test: test:
name: Test ${{ inputs.shard }}/${{ inputs.totalShards }} in project "${{ inputs.project }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out Git repository - name: Check out Git repository
@ -23,4 +27,4 @@ jobs:
- name: Install Node.js dependencies - name: Install Node.js dependencies
run: npm ci run: npm ci
- name: Run tests - 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] shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
uses: ./.github/workflows/test-shard-template.yml uses: ./.github/workflows/test-shard-template.yml
with: with:
project: main
shard: ${{ matrix.shard }} shard: ${{ matrix.shard }}
totalShards: 10 totalShards: 10