File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 9999 tool : cargo-codspeed@2.7.2
100100
101101 - name : Build the benchmark target(s)
102- run : cargo codspeed build --workspace --exclude swc_plugin_runner
102+ run : ./scripts/bench/ build-all-crates.sh
103103
104104 - name : Run the benchmarks
105105 uses : CodSpeedHQ/action@v2
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -eu
4+
5+ echo " Building all crates for codspeed"
6+
7+ WS_CRATES=$( ./scripts/cargo/list-crates.sh)
8+
9+ # Get crate names
10+ CRATE_NAMES=$( echo " $WS_CRATES " | jq -r ' .name' )
11+
12+ for crate in $CRATE_NAMES ; do
13+ # If crate is swc_plugin_runner, skip it
14+ if [[ $crate == " swc_plugin_runner" ]]; then
15+ continue
16+ fi
17+
18+ crate_info=$( echo " $WS_CRATES " | jq -r ' select(.name == "' $crate ' ")' )
19+ bench_targets=$( echo $crate_info | jq -r ' .targets[] | select(.kind | contains(["bench"]))' )
20+
21+
22+ # If crate has no benchmark target, skip it
23+ if [[ -z $bench_targets ]]; then
24+ echo " Skipping $crate because it has no benchmark target"
25+ continue
26+ fi
27+
28+ # If crate has feature 'concurrent', build it with feature
29+ if [[ $( ./scripts/cargo/list-features.sh $crate ) == * " concurrent" * ]]; then
30+ echo " Building $crate with feature 'concurrent'"
31+ cargo codspeed build -p $crate --features concurrent
32+ else
33+ echo " Building $crate "
34+ cargo codspeed build -p $crate
35+ fi
36+ done
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -eu
4+
5+
6+
7+ # Prints json for workspace crates
8+
9+ cargo metadata --format-version 1 | jq -r ' .packages[] | select(.source == null and .name == "' $1 ' ") | .features'
You can’t perform that action at this time.
0 commit comments