Rerun build script only if it was changed #131
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
name: Test | |
on: push | |
jobs: | |
test: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-22.04 | |
- target: x86_64-apple-darwin | |
os: macos-11 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare Environment | |
run: rustup update stable && rustup default stable | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
./target/ | |
key: Test/${{ runner.os }} | |
- name: Run Tests | |
run: cargo test | |
bench: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
ref: dev | |
path: baseline-branch | |
- name: Prepare Environment | |
run: | | |
rustup update stable | |
rustup default stable | |
cargo install cargo-export --version 0.2.0 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
./target/ | |
./baseline-branch/target/ | |
key: Bench/${{ runner.os }} | |
- name: Building Benchmarks | |
run: | | |
cargo export target/benchmarks -- bench --bench=tango | |
cd baseline-branch | |
cargo export target/benchmarks -- bench --bench=tango | |
- name: Run Benchmarks | |
run: | | |
set -eo pipefail | |
target/benchmarks/tango --color=never compare baseline-branch/target/benchmarks/tango \ | |
-v -t 1 --fail-threshold 10 | tee target/benchmark.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: benchmark.txt | |
path: target/benchmark.txt |