pokerogue/.github/workflows/test-shard-template.yml

33 lines
816 B
YAML
Raw Permalink Normal View History

[Bug] Use silent mode during tests (unless debugging!) + test workflow optimization (#4154) * add :silent to all tests but disable it if the runner is in debug mode! * fix: use `--silent` instead of `:silent` Cause the previous was npm scrpt specific (whops) * remove env and replace with logic in each call * reduce redundancy by checking out once * move pre-test into `needs` after `checkout` * use cache approach in pre-test * add node.js install step to `setup` job * WIP: setup -> pre-test -> all other tests with using cache * use matrix approach for tests * fix matrix approach for tests * fix wrong use of env var in `run-test-template.yml` * test: out-comment `run-tests` to see whats wrong * test: see if this works * let's try using matrix again... * make `node-version` input a string * remove `node-version` input for now * test: without a matrix fornow * change usage of reuseable workflow call * fix call of matrix.project * try using working-dir * try setup for pre-tests * remove `runs-on` from run-tests * fix some identations for run-tests * add pre-test as requirement for running tests * use `1` instead of `'1'` to check `runner.debug` * add `options` input. Possible fix for debug = not silent * try again... * not as an ENV but inside * move 2nd ${{ !runner.debug && '--silent' }} check into test-template * fix printing `false` instead of empty-string on runner-debug check * try a yml array approach * test running with file include path * make `project` always `main` for now * remove all extra vitest workspaces * adopt `shards` workflow in vitest * fix workflow reference in tests.yml * add missing `$` in test-shard-template.yml` * chore: fix vitest.config.ts after merge man.. cant trust these machines * make `project` a variable. try to use inputs on job names * adjust `test-shard-template` job name
2024-09-10 22:13:42 +01:00
name: Test Template
on:
workflow_call:
inputs:
project:
required: true
type: string
shard:
required: true
type: number
totalShards:
required: true
type: number
jobs:
test:
name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
[Bug] Use silent mode during tests (unless debugging!) + test workflow optimization (#4154) * add :silent to all tests but disable it if the runner is in debug mode! * fix: use `--silent` instead of `:silent` Cause the previous was npm scrpt specific (whops) * remove env and replace with logic in each call * reduce redundancy by checking out once * move pre-test into `needs` after `checkout` * use cache approach in pre-test * add node.js install step to `setup` job * WIP: setup -> pre-test -> all other tests with using cache * use matrix approach for tests * fix matrix approach for tests * fix wrong use of env var in `run-test-template.yml` * test: out-comment `run-tests` to see whats wrong * test: see if this works * let's try using matrix again... * make `node-version` input a string * remove `node-version` input for now * test: without a matrix fornow * change usage of reuseable workflow call * fix call of matrix.project * try using working-dir * try setup for pre-tests * remove `runs-on` from run-tests * fix some identations for run-tests * add pre-test as requirement for running tests * use `1` instead of `'1'` to check `runner.debug` * add `options` input. Possible fix for debug = not silent * try again... * not as an ENV but inside * move 2nd ${{ !runner.debug && '--silent' }} check into test-template * fix printing `false` instead of empty-string on runner-debug check * try a yml array approach * test running with file include path * make `project` always `main` for now * remove all extra vitest workspaces * adopt `shards` workflow in vitest * fix workflow reference in tests.yml * add missing `$` in test-shard-template.yml` * chore: fix vitest.config.ts after merge man.. cant trust these machines * make `project` a variable. try to use inputs on job names * adjust `test-shard-template` job name
2024-09-10 22:13:42 +01:00
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
run: npx vitest --project ${{ inputs.project }} --shard=${{ inputs.shard }}/${{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }}