Skip to content

Workflow file for this run

name: Googlebenchmark
on:
push:
branches:
- main
- cmake
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
env:
BENCHMARK_INSTALL_DIR: ${{ github.workspace }}/benchmark-install
steps:
- uses: actions/checkout@v2
- name: Checkout Google Benchmark
uses: actions/checkout@v2
with:
repository: google/benchmark
path: 'benchmark'
- name: Build and Install Google Benchmark
run: |
cd benchmark
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${BENCHMARK_INSTALL_DIR}
cmake --build build
cmake --install build
- name: Download and extract boost
id: install-boost
run: |
wget --no-check-certificate 'https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz'
tar xf boost_1_84_0.tar.gz
- name: Check boost
id: check-boost
run: |
echo ${{ steps.install-boost.outputs.BOOST_ROOT }}
ls -l
cd boost_1_84_0
ls -l
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING:BOOL=TRUE -DCMAKE_PREFIX_PATH="${BENCHMARK_INSTALL_DIR};${{runner.workspace}}/boost_1_84_0" -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
- name: Build Loki
working-directory: ${{runner.workspace}}/build
run: export CXXFLAGS="-Werror" && cmake --build .
# Run benchmark and store the output to a file
- name: Run benchmark
run: ${{runner.workspace}}/build/benchmarks/persistent_factory --benchmark_format=json | tee benchmark_result.json
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'googlecpp'
# Where the output from the benchmark tool is stored
output-file-path: benchmark_result.json
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true