Refactor cmake scripts and support LTO #222
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: | |
- "**" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install deps | |
run: | | |
sudo apt-get -y update | |
DEBIAN_FRONTEND="noninteractive" sudo apt-get -y install python3 apt-transport-https build-essential wget cmake git | |
- name: Build | |
run: | | |
set -ex | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DLIBDDWAF_ENABLE_LTO=ON | |
VERBOSE=1 make -j benchmark benchcmp | |
- name: Run Benchmark | |
run: | | |
cd build | |
make run_benchmark | |
- name: Download previous run | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: benchmark.yml | |
workflow_conclusion: success | |
name: benchmark-data | |
path: previous | |
branch: master | |
continue-on-error: true | |
- name: Compare performance | |
run: | | |
./build/perf/benchcmp previous/benchmark_results.json benchmark_results.json | |
continue-on-error: true | |
- name: Artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: benchmark-data | |
path: benchmark_results.json |