| 1 |
|
| 2 |
|
| 3 |
name: Performance Regression Test |
| 4 |
|
| 5 |
on: |
| 6 |
push: |
| 7 |
branches: [main] |
| 8 |
pull_request: |
| 9 |
branches: |
| 10 |
- main |
| 11 |
merge_group: |
| 12 |
types: [checks_requested] |
| 13 |
branches: [main] |
| 14 |
|
| 15 |
env: |
| 16 |
ROOT_PATH: bindings/rust/extended |
| 17 |
|
| 18 |
permissions: |
| 19 |
contents: read |
| 20 |
|
| 21 |
jobs: |
| 22 |
regression-test: |
| 23 |
runs-on: ubuntu-latest |
| 24 |
if: ${{ github.event_name == 'pull_request' }} |
| 25 |
steps: |
| 26 |
|
| 27 |
- name: Checkout code |
| 28 |
uses: actions/checkout@v7 |
| 29 |
with: |
| 30 |
ref: ${{ github.event.pull_request.head.sha }} |
| 31 |
|
| 32 |
|
| 33 |
- name: Install Rust toolchain |
| 34 |
id: toolchain |
| 35 |
run: | |
| 36 |
rustup toolchain install stable |
| 37 |
rustup override set stable |
| 38 |
|
| 39 |
|
| 40 |
- name: Update package list |
| 41 |
run: sudo apt-get update |
| 42 |
|
| 43 |
|
| 44 |
- name: Download Valgrind 3.23 Source |
| 45 |
run: | |
| 46 |
wget https://sourceware.org/pub/valgrind/valgrind-3.23.0.tar.bz2 |
| 47 |
tar -xjf valgrind-3.23.0.tar.bz2 |
| 48 |
cd valgrind-3.23.0 |
| 49 |
./configure |
| 50 |
make |
| 51 |
sudo make install |
| 52 |
|
| 53 |
|
| 54 |
- name: Switch to mainline |
| 55 |
run: | |
| 56 |
git fetch origin main |
| 57 |
git switch main |
| 58 |
|
| 59 |
|
| 60 |
- name: Generate bindings (mainline) |
| 61 |
run: ${{env.ROOT_PATH}}/generate.sh --skip-tests |
| 62 |
|
| 63 |
|
| 64 |
- name: Run scalar performance test (mainline) |
| 65 |
env: |
| 66 |
PERF_MODE: valgrind |
| 67 |
run: cargo test --release --manifest-path=tests/regression/Cargo.toml |
| 68 |
|
| 69 |
|
| 70 |
- name: Checkout pull request branch |
| 71 |
run: git checkout ${{ github.event.pull_request.head.sha }} |
| 72 |
|
| 73 |
|
| 74 |
- name: Generate bindings (PR branch) |
| 75 |
run: ${{env.ROOT_PATH}}/generate.sh --skip-tests |
| 76 |
|
| 77 |
|
| 78 |
- name: Run scalar performance test (PR branch) |
| 79 |
env: |
| 80 |
PERF_MODE: valgrind |
| 81 |
run: cargo test --release --manifest-path=tests/regression/Cargo.toml |
| 82 |
|
| 83 |
|
| 84 |
- name: Run diff test |
| 85 |
env: |
| 86 |
PERF_MODE: diff |
| 87 |
run: cargo test --release --manifest-path=tests/regression/Cargo.toml |
| 88 |
|
| 89 |
|
| 90 |
- name: Upload artifacts |
| 91 |
if: ${{ always() }} |
| 92 |
uses: actions/upload-artifact@v7 |
| 93 |
with: |
| 94 |
name: regression_artifacts |
| 95 |
path: tests/regression/target/regression_artifacts |