name: CodSpeed on: pull_request: paths-ignore: - 'docs/**' - 'justfile' - '.devcontainer' - '**/*.md' - '.gitignore' merge_group: push: branches: - main concurrency: group: codspeed.yml-${{ github.event.pull_request.number || github.run_id }} cancel-in-progress: true permissions: # Write cache contents: write jobs: benchmarks: name: Run benchmarks runs-on: ubuntu-22.04-16core env: BAZEL_ARGS: --config=benchmark --@google_benchmark//:codspeed_mode=simulation --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev steps: - uses: actions/checkout@v6 with: show-progress: false - name: Cache id: cache uses: actions/cache@v5 with: path: ~/bazel-disk-cache key: bazel-disk-cache-benchmarks-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }} - name: Setup Runner uses: ./.github/actions/setup-runner with: GOOGLESOURCE_COOKIE: ${{ secrets.GOOGLESOURCE_COOKIE }} - name: Build benchmarks run: | bazel build ${{ env.BAZEL_ARGS }} --build_tag_filters=google_benchmark //... @capnp-cpp//... - name: Generate benchmark script run: | echo '#!/bin/bash' > run_benchmarks.sh echo 'set -ex' >> run_benchmarks.sh targets=$(bazel query 'attr(tags, "[\[ ]google_benchmark[,\]]", //... + @capnp-cpp//...) except attr(tags, "[\[ ]manual[,\]]", //...)' --output=label 2>/dev/null) for target in $targets; do echo "echo 'Running benchmark: $target'" >> run_benchmarks.sh echo "bazel run ${{ env.BAZEL_ARGS }} $target -- --benchmark_min_time=1s" >> run_benchmarks.sh done chmod +x run_benchmarks.sh - name: Run benchmarks uses: CodSpeedHQ/action@v4 with: mode: simulation run: ./run_benchmarks.sh - name: Bazel shutdown run: bazel shutdown