Skip to content

CI

CI #301

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
cmake-integration-tests:
strategy:
matrix:
include:
- codspeed-mode: "instrumentation"
runner: "ubuntu-latest"
# - codspeed-mode: "walltime"
# runner: "codspeed-macro"
# - codspeed-mode: "off"
# runner: "ubuntu-latest"
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache build
uses: actions/cache@v3
with:
path: examples/google_benchmark_cmake/build
key: ${{ runner.os }}-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Create build directory
run: mkdir -p examples/google_benchmark_cmake/build
- name: Build benchmark example
run: |
cd examples/google_benchmark_cmake/build
cmake -DCODSPEED_MODE=${{ matrix.codspeed-mode }} ..
make -j
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4.1.0
if: matrix.codspeed-mode != 'off'
with:
mode: ${{ matrix.codspeed-mode }}
run: examples/google_benchmark_cmake/build/benchmark_example
token: ${{ secrets.CODSPEED_TOKEN }}
bazel-integration-tests:
strategy:
matrix:
include:
- codspeed-mode: "instrumentation"
runner: "ubuntu-latest"
# - codspeed-mode: "walltime"
# runner: "codspeed-macro"
# - codspeed-mode: "off"
# runner: "ubuntu-latest"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Bazel
uses: bazel-contrib/setup-bazel@0.14.0
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Build and run benchmarks
run: |
bazel build //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }}
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4.1.0
if: matrix.codspeed-mode != 'off'
with:
mode: ${{ matrix.codspeed-mode }}
run: bazel run //examples/google_benchmark_bazel:my_benchmark --//core:codspeed_mode=${{ matrix.codspeed-mode }}
token: ${{ secrets.CODSPEED_TOKEN }}