diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3df34fa..012aee9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -38,15 +38,18 @@ jobs: MISE_LOG_LEVEL: ${{ runner.debug == '1' && 'trace' || 'info' }} test: + name: test (${{ matrix.os }}, shard ${{ matrix.shard }}) timeout-minutes: 30 concurrency: - group: test-${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} + group: >- + test-${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.shard }} cancel-in-progress: false queue: max strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] + shard: ["1/3", "2/3", "3/3"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7.0.1 @@ -57,7 +60,7 @@ jobs: cache: true experimental: true log_level: ${{ runner.debug == '1' && 'trace' || 'info' }} - - run: mise test + - run: mise test --shard ${{ matrix.shard }} env: MISE_LOG_LEVEL: ${{ runner.debug == '1' && 'trace' || 'info' }} LOGTAPE_TEST_MODE: ${{ runner.debug == '1' && 'always' || 'on-failure' }} diff --git a/mise.toml b/mise.toml index 57a094b..618e4fd 100644 --- a/mise.toml +++ b/mise.toml @@ -250,6 +250,7 @@ description = "Run tests" depends = ["build"] usage = ''' flag "-d --debug" help="Run tests in debug mode" +flag "--shard " help="Run one test shard as INDEX/TOTAL" ''' run = ''' #!/usr/bin/env nu @@ -260,7 +261,8 @@ if "usage_debug" in $env { $env.LOGTAPE_TEST_MODE = "on-failure" $env.LOGTAPE_TEST_LOWEST_LEVEL = "debug" } -pnpm run --parallel --recursive test --test-concurrency=1 +let shard = (if "usage_shard" in $env { [$"--test-shard=($env.usage_shard)"] } else { [] }) +node --test ...$shard "packages/*/src/**/*.test.ts" ''' [tasks."test:postgres"]