Unite templated and non-templated methods #26
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: Benchmarking | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
Measure: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install packages | |
run: sudo apt-get -qq install libbenchmark-dev libgmp3-dev libcrypto++-dev libcrypto++-doc libcrypto++-utils | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "ci=${{ github.workspace }}/ci/benchmarking" >> "$GITHUB_OUTPUT" | |
echo "benchmark=${{ github.workspace }}/benchmark" >> "$GITHUB_OUTPUT" | |
echo "build=${{ github.workspace }}/benchmark/cmake-build-release" >> "$GITHUB_OUTPUT" | |
- name: Load CMake configuration | |
run: > | |
cmake -B ${{ steps.strings.outputs.build }} | |
-DCMAKE_CXX_COMPILER=g++ | |
-DCMAKE_C_COMPILER=gcc | |
-DCMAKE_BUILD_TYPE=Release | |
-S ${{ steps.strings.outputs.benchmark }} | |
- name: Build executable | |
run: cmake --build ${{ steps.strings.outputs.build }} --target Benchmarking -j8 | |
- name: Run benchmark analysis | |
working-directory: ${{ steps.strings.outputs.build }} | |
run: ./Benchmarking --benchmark_out=benchmarks.json | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install python packages | |
run: | | |
python -m pip install -q --upgrade pip | |
pip install -q matplotlib numpy requests | |
- name: Download font file | |
working-directory: ${{ steps.strings.outputs.ci }} | |
run: wget https://github.com/google/fonts/raw/refs/heads/main/ofl/courierprime/CourierPrime-Bold.ttf -q | |
- name: Run Python script | |
working-directory: ${{ steps.strings.outputs.ci }} | |
run: python make_plot.py ${{ steps.strings.outputs.build }}/benchmarks.json graph.png CourierPrime-Bold.ttf | |
- name: Upload a picture | |
uses: devicons/[email protected] | |
id: imgur_step | |
with: | |
path: ${{ steps.strings.outputs.ci }}/graph.png | |
client_id: ${{ secrets.IMGUR_CLIENT_ID }} | |
- name: Update image link | |
working-directory: ${{ steps.strings.outputs.ci }} | |
run: python update_image_link.py ${{ secrets.DUB_CO_LINK_ID }} ${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[0] }} ${{ secrets.DUB_CO_API_KEY }} | |