• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1on:
2  # For some reason, this fails due to some permissions.
3  # pull_request:
4  push:
5    branches:
6      - master
7  # Run once a week to preserve the cache
8  # (even though it still feels the cache gets lost sometimes?)
9  # FIXME: Doesn't seem to be working. Using the GH pages thing for now.
10  #schedule:
11  #  - cron: '0 0 * * 0'
12
13name: benchmark pull requests
14
15jobs:
16  runBenchmark:
17    name: run benchmark
18    runs-on: ubuntu-latest
19    steps:
20      - name: Checkout
21        uses: actions/checkout@v2
22        with:
23          fetch-depth: 0
24
25      - name: Install Rust
26        uses: actions-rs/toolchain@v1
27        with:
28          toolchain: stable
29          default: true
30          profile: minimal
31
32      - name: Restore compile cache
33        uses: Swatinem/rust-cache@v1
34
35      - name: Restore previous benchmark data
36        uses: actions/cache@v2
37        with:
38          path: ./bench-cache
39          key: ${{ runner.os }}-benchmark
40
41      - name: Run benchmarks
42        # We choose just the tracking ones. There's a whole fleet that we check
43        # that compile, but they are too heavy both to run in CI and to show in
44        # the PRs. And they mostly compare us to other methods.
45        #
46        # Provide the bencher output, as the following tool knows how to read that.
47        run: cargo bench --bench track -- --output-format bencher | grep -v 'Gnuplot not found' | tee benches.out
48
49      - name: Compare benchmarks
50        uses: rhysd/github-action-benchmark@4eed2c2f4cd0d374720c4b913f79faa8aafcfa6b
51        with:
52          name: Track benchmarks
53          tool: cargo
54          output-file-path: benches.out
55          github-token: ${{ secrets.GITHUB_TOKEN }}
56          auto-push: true
57          alert-threshold: '150%'
58          comment-on-alert: true
59          comment-always: true
60          # We don't want that to fail. Both our benchmarks and the CI are a
61          # bit noisy and we have quite a few measurements, so the chance of
62          # one failing at random is quite high. It's still nice to have it
63          # measured and available as a comment.
64          fail-on-alert: false
65          #external-data-json-path: ./bench-cache/benchmark-data.json
66          # Because it doesn't put it into the PR, it puts it into the commit :-|
67          alert-comment-cc-users: '@vorner'
68