forked from aws/s2n-tls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add performance regression tests in CI (aws#4701)
- Loading branch information
1 parent
3baca01
commit 87f4a05
Showing
3 changed files
with
142 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: MIT-0 | ||
name: Performance Regression Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- tests/regression/** | ||
|
||
jobs: | ||
regression-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the code from the pull request branch | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
# Install the stable Rust toolchain | ||
- name: Install Rust toolchain | ||
id: toolchain | ||
run: | | ||
rustup toolchain install stable | ||
rustup override set stable | ||
# Update the package list on the runner | ||
- name: Update package list | ||
run: sudo apt-get update | ||
|
||
# Download and install Valgrind 3.23 from source | ||
- name: Download Valgrind 3.23 Source | ||
run: | | ||
wget https://sourceware.org/pub/valgrind/valgrind-3.23.0.tar.bz2 | ||
tar -xjf valgrind-3.23.0.tar.bz2 | ||
cd valgrind-3.23.0 | ||
./configure | ||
make | ||
sudo make install | ||
# Generate the necessary bindings | ||
- name: Generate | ||
run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests | ||
|
||
# Run performance tests using Valgrind for current branch | ||
- name: Run scalar performance test (curr) | ||
env: | ||
PERF_MODE: valgrind | ||
run: cargo test --release --manifest-path=tests/regression/Cargo.toml | ||
|
||
# Switch to the main branch | ||
- name: Switch to mainline | ||
run: | | ||
git fetch origin main | ||
git switch main | ||
# Regenerate bindings for main branch | ||
- name: Generate | ||
run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests | ||
|
||
# Run performance tests using Valgrind for main branch | ||
- name: Run scalar performance test (prev) | ||
env: | ||
PERF_MODE: valgrind | ||
run: cargo test --release --manifest-path=tests/regression/Cargo.toml | ||
|
||
# Checkout pull request branch again | ||
# This is required for cg_annotate diff to locate the changes in the PR to properly annotate the output diff file | ||
- name: Checkout pull request branch | ||
run: git checkout ${{ github.event.pull_request.head.sha }} | ||
|
||
# Run the differential performance test | ||
- name: Run diff test | ||
env: | ||
PERF_MODE: diff | ||
run: cargo test --release --manifest-path=tests/regression/Cargo.toml | ||
|
||
# Upload the performance output artifacts. This runs even if run diff test fails so debug files can be accessed | ||
- name: Upload artifacts | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: regression_artifacts | ||
path: tests/regression/target/regression_artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters