path2 #6
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: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc g++ cmake lcov gcovr | |
sudo apt-get install -y libgtest-dev | |
cd /usr/src/gtest | |
sudo cmake CMakeLists.txt | |
sudo make | |
sudo cp ./lib/libgtest*.a /usr/lib | |
- name: Clone libbenchmark | |
run: git clone https://github.com/google/benchmark.git | |
- name: Build libbenchmark | |
run: | | |
cd benchmark | |
cmake -E make_directory "build" | |
cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../ | |
cmake --build "build" --config Release | |
- name: Install libbenchmark | |
run: sudo cmake --build "build" --target install --config Release | |
working-directory: ./benchmark | |
- name: Configure CMake | |
run: cmake -S . -B build -DBUILD_PERF=ON | |
- name: Build | |
run: cmake --build build --config Release | |
- name: Run benchmark | |
run: | | |
cd build/test/perftest | |
./cpp-oasvalidator-perftests > --benchmark_out=benchmark_result.json --benchmark_format=json > benchmark_result.json | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Generate HTML Page | |
run: | | |
pwd | |
python .github/workflows/convert_json_to_html.py build/test/perftest/benchmark_result.json | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/test/perftest/benchmark_report.html |