-
-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (50 loc) · 1.63 KB
/
performance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Rust performance
on:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
test: [od_robust_test_ekf_realistic_two_way, traj_spacecraft, gmat_val_leo_day_adaptive, stop_cond_nrho_apo]
steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: perf-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: perf-cargo-
- name: Run cargo test
run: cargo test --no-run ${{ matrix.test }}
- name: Parse executable
id: executable
run: |
executable=$(echo "${{ steps.test.outputs.stdout }}" | awk '/^ Executable / { match($0, /Executable .* (\S+) \(/, groups); print groups[1] }')
echo "::set-output name=exec::$executable"
- name: Install flamegraph
run: |
sudo apt-get update
sudo apt install linux-tools-common linux-tools-generic linux-tools-`uname -r`
cargo install flamegraph
- name: Run flamegraph
run: |
sudo sysctl kernel.perf_event_paranoid=-1
flamegraph -o flame-${{ matrix.test }}.svg -- ${{ steps.executable.outputs.exec }} ${{ matrix.test }}
- name: Upload python tests HTMLs
uses: actions/upload-artifact@v3
with:
name: flamegraph
path: flame-*.svg