Add benchmarks comparing job

This commit is contained in:
Siarhei Fedartsou 2024-05-11 16:40:06 +02:00
parent 9071ba7fba
commit c7653cce6a

View File

@ -607,41 +607,49 @@ jobs:
CXXCOMPILER: clang++-13 CXXCOMPILER: clang++-13
CC: clang-13 CC: clang-13
CXX: clang++-13 CXX: clang++-13
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps: steps:
- name: Checkout PR Branch - name: Checkout PR Branch
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: ${{ github.head_ref }} ref: ${{ github.head_ref }}
path: pr
- run: pip install "conan<2.0.0" - run: pip install "conan<2.0.0"
- name: Build - name: Build
run: | run: |
rm -rf build mkdir -p pr/build
mkdir build cd pr/build
cd build
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
make -j$(nproc) benchmarks make -j$(nproc) benchmarks
cd .. cd ..
make -C test/data make -C test/data
- name: Run Benchmark on Master Branch - name: Run Benchmark on Master Branch
run: | run: |
./build/src/benchmarks/match-bench ../test/data/mld/monaco.osrm mld > pr_bench.txt ./pr/build/src/benchmarks/match-bench ../test/data/mld/monaco.osrm mld > pr_bench.txt
- name: Checkout Master Branch - name: Checkout Master Branch
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: master ref: master
path: master
- name: Build - name: Build
run: | run: |
rm -rf build mkdir master/build
mkdir build cd master/build
cd build
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
make -j$(nproc) benchmarks make -j$(nproc) benchmarks
cd .. cd ..
make -C test/data make -C test/data
- name: Run Benchmark on Master Branch - name: Run Benchmark on Master Branch
run: | run: |
./build/src/benchmarks/match-bench ../test/data/mld/monaco.osrm mld > master_bench.txt ./master/build/src/benchmarks/match-bench ../test/data/mld/monaco.osrm mld > master_bench.txt
- name: Compare Benchmarks - name: Compare Benchmarks
run: | run: |
cat pr_bench.txt cat pr_bench.txt
cat master_bench.txt cat master_bench.txt
- name: Run benchmark and update PR
- name: Post Benchmark Results
run: |
python3 scripts/ci/post_benchmark_results.py