Skip to content

update unittest workflow with new dependency handling #87

update unittest workflow with new dependency handling

update unittest workflow with new dependency handling #87

Workflow file for this run

name: Googlebenchmark
on:
push:
branches:
- main
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
steps:
- name: Checkout Loki
uses: actions/checkout@v2
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
dependencies/benchmark-install
dependencies/boost
dependencies/googletest-install
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/dependencies/benchmark/CMakeLists.txt', '**/dependencies/boost/CMakeLists.txt', '**/dependencies/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake files
- name: Configure, Build, and Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
cmake -S dependencies -B dependencies/build
cmake --build dependencies/build -j$(nproc)
- name: Configure, and Build Loki
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING=ON -S . -B build
cmake --build build -j$(nproc)
# Run benchmarks and store the output to a file
- name: Run benchmark construct_atoms
run: build/benchmarks/construct_atoms --benchmark_format=json | tee benchmark_result_construct_atoms.json
- name: Run benchmark iterate_atoms
run: build/benchmarks/iterate_atoms --benchmark_format=json | tee benchmark_result_iterate_atoms.json
# Combine outputs to a single file
- name: Combine JSON files
run: python3 benchmarks/combine_results.py benchmark_result_construct_atoms.json benchmark_result_iterate_atoms.json > 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