chore(bench): fix handling ommit --bench arg #10
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: Rust Benches | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Dependencies | |
run: | | |
sudo apt-get install -y --no-install-recommends curl unzip gpg ca-certificates git openssh-client && sudo apt-get update | |
- name: Install Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
rustup update stable | |
- name: Build | |
run: cargo build --verbose --release | |
- name: Download and Set Up Headless-Shell | |
run: | | |
sudo mkdir -p /out/latest/headless-shell | |
sudo curl -SL https://storage.googleapis.com/chrome-for-testing-public/133.0.6943.126/linux64/chrome-headless-shell-linux64.zip -o chrome-headless-shell-linux64.zip | |
sudo unzip chrome-headless-shell-linux64.zip -d /out/latest/headless-shell | |
sudo chmod +x /out/latest/headless-shell/chrome-headless-shell-linux64/chrome-headless-shell | |
sudo chmod -R 777 /out | |
npx playwright install-deps chromium | |
- name: Run Benches | |
run: | | |
cargo bench | |
env: | |
HEADLESS: true | |
CHROME_PATH: /out/latest/headless-shell/chrome-headless-shell-linux64/chrome-headless-shell | |
RUST_LOG: info,error,warn | |
TEST_NO_ARGS: false | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git add benches/logs/ | |
git commit -m "Update benchmark logs" || echo "No changes to commit" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |