Repository navigation
feat(code-slack): host the Slack bot as an OpenChannel Protocol agent #211
This file contains hidden or 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: Benchmarks | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| benchmark: | |
| name: Run Benchmarks | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pinned Rust toolchain | |
| run: rustup show | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run benchmarks | |
| run: | | |
| if cargo bench --help > /dev/null 2>&1; then | |
| cargo bench --workspace | |
| else | |
| echo "No benchmarks found, skipping..." | |
| fi | |
| - name: Check for benchmark results | |
| id: bench-check | |
| run: | | |
| if [ -f target/criterion/reports/index.html ]; then | |
| echo "has-benchmarks=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "No benchmarks found, will skip storing results" | |
| echo "has-benchmarks=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| if: steps.bench-check.outputs.has-benchmarks == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| with: | |
| tool: 'cargo' | |
| output-file-path: target/criterion/reports/index.html | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: true | |
| comment-on-alert: true | |
| alert-threshold: '200%' | |
| fail-on-alert: true |