Skip to content

Add Rc<T> and Arc<T> sources #32

Add Rc<T> and Arc<T> sources

Add Rc<T> and Arc<T> sources #32

Workflow file for this run

on:
pull_request:
paths:
- '**.rs'
- '**/Cargo.toml'
workflow_dispatch:
name: Benchmark
permissions:
pull-requests: write
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install Critcmp
uses: baptiste0928/cargo-install@v2
with:
crate: critcmp
version: latest
- name: Run Benchmarks on changes
run: cargo bench --bench bench -- --save-baseline changes
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.sha }}
clean: false
- name: Run Benchmarks before changes
run: cargo bench --bench bench -- --save-baseline before
- name: Compare benchmarks
run: |
echo 'results<<EOF' >> $GITHUB_OUTPUT
critcmp before changes >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
id: compare
- name: Comment PR with benchmarks
uses: thollander/actions-comment-pull-request@v2
continue-on-error: true
with:
message: |
Benchmark results:
```
${{ steps.compare.outputs.results }}
```
comment_tag: benchmarks
id: comment
- name: If PR comment failed, write to PR summary
if: steps.comment.outcome != 'success'
run: |
echo '### Benchmark results' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.compare.outputs.results }}' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY