diff --git a/.github/workflows/test-shard-template.yml b/.github/workflows/test-shard-template.yml new file mode 100644 index 00000000000..5faf8620c71 --- /dev/null +++ b/.github/workflows/test-shard-template.yml @@ -0,0 +1,26 @@ +name: Test Template + +on: + workflow_call: + inputs: + shard: + required: true + type: number + totalShards: + required: true + type: number + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + - 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 main --shard={{ inputs.shard }}/{{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 685c5d24f08..74256e088cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,16 +35,12 @@ jobs: run: npx vitest run --project pre ${{ !runner.debug && '--silent' || '' }} run-tests: - name: Run Tests + name: Run Tests needs: [pre-test] strategy: matrix: - project: - # - misc - - "src/test/abilities/**/*.{test,spec}.ts" - # - items - # - moves - # - battle + shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] uses: ./.github/workflows/run-test-template.yml with: - project: ${{ matrix.project }} \ No newline at end of file + shard: ${{ matrix.shard }} + totalShards: 10 \ No newline at end of file