Skip to content

Commit 9c8b7d0

Browse files
committed
ci: group benchmark packages into categories and increase timeout
1 parent 4f9a39b commit 9c8b7d0

1 file changed

Lines changed: 35 additions & 43 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,17 @@ concurrency:
1919

2020
jobs:
2121
benchmarks:
22-
name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }} (CodSpeed)
22+
name: Run ${{ matrix.type }} benchmarks for ${{ matrix.group }} packages (CodSpeed)
2323
runs-on: ubuntu-latest
24-
timeout-minutes: 90
24+
timeout-minutes: 180
2525
env:
2626
CARGO_INCREMENTAL: 0
2727
strategy:
28+
fail-fast: false
29+
max-parallel: 4
2830
matrix:
2931
type: [simulation, memory]
30-
package: [
31-
uu_base64,
32-
uu_cksum,
33-
uu_cp,
34-
uu_cat,
35-
uu_cut,
36-
uu_dd,
37-
uu_df,
38-
uu_du,
39-
uu_echo,
40-
uu_expand,
41-
uu_fold,
42-
uu_hostname,
43-
uu_join,
44-
uu_ls,
45-
uu_mv,
46-
uu_nl,
47-
uu_numfmt,
48-
uu_rm,
49-
uu_seq,
50-
uu_shuf,
51-
uu_sort,
52-
uu_split,
53-
uu_tee,
54-
uu_timeout,
55-
uu_tsort,
56-
uu_unexpand,
57-
uu_uniq,
58-
uu_wc,
59-
uu_factor,
60-
uu_date,
61-
uu_csplit,
62-
uu_true,
63-
uu_false
64-
]
32+
group: [text, file, numeric, misc]
6533
steps:
6634
- uses: actions/checkout@v6
6735
with:
@@ -92,19 +60,43 @@ jobs:
9260
with:
9361
tool: cargo-codspeed
9462

95-
- name: Build benchmarks for ${{ matrix.package }} (${{ matrix.type }})
63+
- name: Select benchmark packages
9664
shell: bash
9765
run: |
98-
echo "Building ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
99-
cargo codspeed build -m ${{ matrix.type }} -p ${{ matrix.package }}
66+
case "${{ matrix.group }}" in
67+
text)
68+
packages="uu_cat uu_cut uu_fold uu_join uu_nl uu_sort uu_uniq uu_wc"
69+
;;
70+
file)
71+
packages="uu_cp uu_dd uu_df uu_du uu_ls uu_mv uu_rm"
72+
;;
73+
numeric)
74+
packages="uu_cksum uu_numfmt uu_seq uu_factor"
75+
;;
76+
misc)
77+
packages="uu_base64 uu_echo uu_expand uu_hostname uu_shuf uu_split uu_tee uu_timeout uu_tsort uu_unexpand uu_date uu_csplit uu_true uu_false"
78+
;;
79+
esac
10080
101-
- name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }}
81+
echo "BENCHMARK_PACKAGES=${packages}" >> $GITHUB_ENV
82+
83+
- name: Build benchmarks for ${{ matrix.group }} packages (${{ matrix.type }})
84+
shell: bash
85+
run: |
86+
for package in ${BENCHMARK_PACKAGES}; do
87+
echo "Building ${{ matrix.type }} benchmarks for ${package}"
88+
cargo codspeed build -m ${{ matrix.type }} -p "${package}"
89+
done
90+
91+
- name: Run ${{ matrix.type }} benchmarks for ${{ matrix.group }} packages
10292
uses: CodSpeedHQ/action@v4
10393
env:
10494
CODSPEED_LOG: debug
10595
with:
10696
mode: ${{ matrix.type }}
10797
run: |
108-
echo "Running ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
109-
cargo codspeed run -p ${{ matrix.package }} > /dev/null
98+
for package in ${BENCHMARK_PACKAGES}; do
99+
echo "Running ${{ matrix.type }} benchmarks for ${package}"
100+
cargo codspeed run -p "${package}" > /dev/null
101+
done
110102
token: ${{ secrets.CODSPEED_TOKEN }}

0 commit comments

Comments
 (0)