From c6080e700c2212ba2d52f57f181ace7ab26edb32 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:06:57 -0700 Subject: [PATCH] add `options` input. Possible fix for debug = not silent --- .github/workflows/run-test-template.yml | 5 ++++- .github/workflows/tests.yml | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-test-template.yml b/.github/workflows/run-test-template.yml index c8779f020fc..8c80aa83648 100644 --- a/.github/workflows/run-test-template.yml +++ b/.github/workflows/run-test-template.yml @@ -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 }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d2cd2567f1..8813865a68b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} \ No newline at end of file + project: ${{ matrix.project }} + options: $VITEST_OPTIONS \ No newline at end of file