add options input. Possible fix for debug = not silent

This commit is contained in:
flx-sta 2024-09-10 12:06:57 -07:00
parent 53a22a3c9f
commit c6080e700c
2 changed files with 10 additions and 3 deletions

View File

@ -6,6 +6,9 @@ on:
project:
required: true
type: string
options:
required: false
type: string
jobs:
test:
@ -20,4 +23,4 @@ jobs:
- name: Install Node.js dependencies
run: npm ci
- name: Run ${{ inputs.project }} tests
run: npx vitest --project ${{ inputs.project }} ${{ runner.debug == 1 && '' || '--silent' }}
run: npx vitest --project ${{ inputs.project }} ${{ inputs.options }}

View File

@ -1,5 +1,8 @@
name: Tests
env:
VITEST_OPTIONS: ${{ !runner.debug && '--silent' }}
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
@ -32,7 +35,7 @@ jobs:
run: npm ci
- name: Run Pre-test
working-directory: tests-action
run: npx vitest run --project pre ${{ runner.debug == 1 && '' || '--silent' }}
run: npx vitest run --project pre $VITEST_OPTIONS
run-tests:
name: Run Tests
@ -42,4 +45,5 @@ jobs:
project: [misc, abilities, items, moves, battle]
uses: ./.github/workflows/run-test-template.yml
with:
project: ${{ matrix.project }}
project: ${{ matrix.project }}
options: $VITEST_OPTIONS