Skip to content

Commit

Permalink
chore: Increase test sharding
Browse files Browse the repository at this point in the history
GitHub Action runners have become exceptionally slow, taking over a
minute and a half to run a single test that takes a couple of seconds
locally. Reduce the number of tests run per shard to compensate for
this.
  • Loading branch information
twpayne committed Jan 10, 2025
1 parent b3dd762 commit 7a34950
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-index: [0, 1, 2]
test-index: [0, 1, 2, 3]
needs: changes
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
runs-on: macos-15
Expand Down Expand Up @@ -169,9 +169,11 @@ jobs:
go test ./... -short -race
go test ./internal/cmd -run=TestScript -filter='^[0-9a-dA-D]' -race
elif [ "${{ matrix.test-index }}" = "1" ]; then
go test ./internal/cmd -run=TestScript -filter='^[e-iE-I]' -race
go test ./internal/cmd -run=TestScript -filter='^[e-hE-H]' -race
elif [ "${{ matrix.test-index }}" = "2" ]; then
go test ./internal/cmd -run=TestScript -filter='^[i-qI-Q]' -race
else
go test ./internal/cmd -run=TestScript -filter='^[j-zJ-Z]' -race
go test ./internal/cmd -run=TestScript -filter='^[r-zR-Z]' -race
fi
test-oldstable-go:
needs: changes
Expand Down Expand Up @@ -353,7 +355,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-index: [0, 1, 2]
test-index: [0, 1, 2, 3]
needs: changes
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
runs-on: windows-2022
Expand All @@ -378,9 +380,11 @@ jobs:
go test ./... -short -race
go test ./internal/cmd -run=TestScript -filter='^[0-9a-cA-C]' -race
} elseif (${{ matrix.test-index }} -eq 1) {
go test ./internal/cmd -run=TestScript -filter='^[d-lD-L]' -race
go test ./internal/cmd -run=TestScript -filter='^[d-fD-F]' -race
} elseif (${{ matrix.test-index }} -eq 2) {
go test ./internal/cmd -run=TestScript -filter='^[g-mG-M]' -race
} else {
go test ./internal/cmd -run=TestScript -filter='^[m-zM-Z]' -race
go test ./internal/cmd -run=TestScript -filter='^[n-zN-Z]' -race
}
check:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 7a34950

Please sign in to comment.