name: Benchmark on: pull_request: branches: [master] types: [opened, reopened, synchronize] concurrency: group: benchmark-${{ github.head_ref }} cancel-in-progress: true jobs: benchmark: name: Benchmark runs-on: ubuntu-latest steps: - name: Install rust uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - name: Checkout base uses: actions/checkout@v2 with: ref: master - name: Bench base run: cargo bench -- --output-format bencher | tee output.txt - name: Save base benchmark uses: pksunkara/github-action-benchmark@v1 with: tool: cargo output-file-path: output.txt external-data-json-path: ./benchmark-data.json read-commit-id: true - name: Checkout pull request uses: actions/checkout@v2 with: clean: false - name: Bench pull request run: cargo bench -- --output-format bencher | tee output.txt - name: Compare benchmarks uses: pksunkara/github-action-benchmark@v2 with: tool: cargo output-file-path: output.txt external-data-json-path: ./benchmark-data.json github-token: ${{ github.token }} annotate-always: true