Skip to content

Commit f02f2f8

Browse files
committed
Check if runtime benchmarks can be compiled in CI
1 parent a8fb050 commit f02f2f8

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,42 @@ jobs:
109109
run: cargo build -p collector
110110

111111
- name: Check benchmarks
112-
run: sh -x -c "ci/check-benchmarks.sh"
112+
run: sh -x -c "ci/check-compile-benchmarks.sh"
113113
env:
114114
JEMALLOC_OVERRIDE: /usr/lib/x86_64-linux-gnu/libjemalloc.so
115115
BENCH_INCLUDE_EXCLUDE_OPTS: ${{ matrix.BENCH_INCLUDE_EXCLUDE_OPTS }}
116116
PROFILES: ${{ matrix.PROFILES }}
117117
SHELL: "/bin/bash"
118118

119+
test_runtime_benchmarks:
120+
name: Test runtime benchmarks
121+
runs-on: ubuntu-latest
122+
steps:
123+
- name: Checkout the source code
124+
uses: actions/checkout@v2
125+
with:
126+
fetch-depth: 1
127+
128+
- name: Install latest beta
129+
uses: actions-rs/toolchain@v1
130+
with:
131+
toolchain: beta
132+
override: true
133+
134+
- name: Configure environment
135+
run: |
136+
sudo apt-get update
137+
sudo apt-get install -y linux-tools-common linux-tools-generic linux-tools-`uname -r`
138+
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
139+
140+
- name: Build collector
141+
run: cargo build -p collector
142+
143+
- name: Check runtime benchmarks
144+
run: sh -x -c "ci/check-runtime-benchmarks.sh"
145+
env:
146+
SHELL: "/bin/bash"
147+
119148
test_profiling:
120149
name: Test profiling
121150
runs-on: ubuntu-22.04
File renamed without changes.

ci/check-runtime-benchmarks.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -eE -x;
4+
5+
bash -c "while true; do sleep 30; echo \$(date) - running ...; done" &
6+
PING_LOOP_PID=$!
7+
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
8+
9+
# Check if the runtime benchmarks can be compiled.
10+
# Once we can actually run the benchmarks on CI, we will also execute them here.
11+
# Currently it is not possible because of `perf` permission issues when gathering perf. counters.
12+
cd collector/runtime-benchmarks
13+
cargo check
14+
15+
kill $PING_LOOP_PID
16+
exit 0

0 commit comments

Comments
 (0)