chore(ci): fix publish crates (#385) #121
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: Bencher | |
on: | |
push: | |
branches: main | |
workflow_dispatch: | |
jobs: | |
benchmark_base: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bencherdev/bencher@main | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Base branch benchmarks | |
run: | | |
bencher run \ | |
--branch main \ | |
--testbed ubuntu-latest \ | |
--err | |
env: | |
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} | |
BENCHER_CMD: cargo bench --all-features | |
BENCHER_PROJECT: socketioxide | |
benchmark_pr: | |
if: github.event_name == 'workflow_dispatch' && github.event.pull_request.head.repo.full_name == github.repository | |
permissions: | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: bencherdev/bencher@main | |
- name: PR benchmarks | |
run: | | |
bencher run \ | |
--branch '${{ github.head_ref }}' \ | |
--branch-start-point '${{ github.base_ref }}' \ | |
--testbed ubuntu-latest \ | |
--err \ | |
--github-actions '${{ secrets.GITHUB_TOKEN }}' | |
env: | |
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} | |
BENCHER_CMD: cargo bench --all-features | |
BENCHER_PROJECT: socketioxide |