Skip to content

Commit 6cb2bc9

Browse files
committed
Allocate CI runners to five Windows shards and one Linux shard
1 parent 653a990 commit 6cb2bc9

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: Tests
22
on:
33
push:
4-
branches: [main]
4+
branches: [main, perf/asymmetric-shards]
55
pull_request:
66
branches: [main]
77

88
jobs:
99
rspec:
10-
name: rspec (${{ matrix.ruby-version }}, ${{ matrix.os }}, shard ${{ matrix.shard }})
11-
timeout-minutes: ${{ matrix.os == 'windows' && 30 || 15 }}
12-
runs-on: ${{ format('{0}-latest', matrix.os) }}
10+
name: rspec (${{ matrix.ruby-version }}, ${{ matrix.target.os }}, shard ${{ matrix.target.shard }})
11+
timeout-minutes: ${{ matrix.target.os == 'windows' && 30 || 15 }}
12+
runs-on: ${{ format('{0}-latest', matrix.target.os) }}
1313
env:
1414
BUNDLE_WITHOUT: lint
15-
SPEC_WORKERS: ${{ matrix.os == 'windows' && 4 || 8 }}
16-
SPEC_SHARD: ${{ matrix.shard }}
15+
SPEC_WORKERS: ${{ matrix.target.os == 'windows' && 4 || 8 }}
16+
SPEC_SHARD: ${{ matrix.target.shard }}
1717

1818
strategy:
1919
fail-fast: false
@@ -22,10 +22,13 @@ jobs:
2222
- "3.3"
2323
- "3.4"
2424
- "4.0"
25-
os:
26-
- ubuntu
27-
- windows
28-
shard: ["1/3", "2/3", "3/3"]
25+
target:
26+
- { os: ubuntu, shard: "1/1" }
27+
- { os: windows, shard: "1/5" }
28+
- { os: windows, shard: "2/5" }
29+
- { os: windows, shard: "3/5" }
30+
- { os: windows, shard: "4/5" }
31+
- { os: windows, shard: "5/5" }
2932

3033
steps:
3134
- uses: actions/checkout@v4
@@ -56,7 +59,7 @@ jobs:
5659
uses: coverallsapp/github-action@v2
5760
with:
5861
github-token: ${{ secrets.github_token }}
59-
flag-name: ruby${{ matrix.ruby-version }}-${{ matrix.os }}-shard${{ strategy.job-index }}
62+
flag-name: ruby${{ matrix.ruby-version }}-${{ matrix.target.os }}-shard${{ strategy.job-index }}
6063
parallel: true
6164

6265
overcommit:

‎spec/spec_shard_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
described_class.new('1/1').select(examples).should == examples
1010
end
1111

12-
[2, 3].each do |total|
12+
[2, 3, 5].each do |total|
1313
context "with #{total} shards" do
1414
let(:shards) do
1515
(1..total).map { |index| described_class.new("#{index}/#{total}").select(examples) }

0 commit comments

Comments
 (0)