forked from HEP-FCC/FCCAnalyses
-
Notifications
You must be signed in to change notification settings - Fork 10
76 lines (74 loc) · 2.54 KB
/
bench.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Benchmark
on:
push:
branches:
- master
jobs:
bench:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- STACK: '/cvmfs/sw.hsf.org/key4hep/setup.sh'
NAME: prod
- STACK: '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh'
NAME: nightly
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-d ghcr.io/key4hep/key4hep-images/alma9:latest \
/bin/bash
- name: CMake Configure
run: |
docker exec CI_container /bin/bash -c 'cd Package;\
mkdir -p build install;\
source ${{ matrix.STACK }};\
cd build;\
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja ..;'
- name: Compile
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
source ${{ matrix.STACK }};\
cd build;\
ninja -k0;'
- name: Install
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
source ${{ matrix.STACK }};\
cd build;\
ninja -k0 install;'
- name: Test
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
source ${{ matrix.STACK }};\
cd build;\
ninja -k0 && ctest --output-on-failure;'
- name: Prepare benchmark outputs
run: |
docker exec CI_container /bin/bash -c 'yum install -y jq
cd ./Package
jq ".[].name |= \"${{ matrix.NAME }} | \" + ." benchmarks_smaller_better.json > tmp.json
mv tmp.json benchmarks_smaller_better.json
jq ".[].name |= \"${{ matrix.NAME }} | \" + ." benchmarks_bigger_better.json > tmp.json
mv tmp.json benchmarks_bigger_better.json
'
- name: Store benchmark result --- smaller better
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customSmallerIsBetter'
output-file-path: benchmarks_smaller_better.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
- name: Store benchmark result --- bigger better
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customBiggerIsBetter'
output-file-path: benchmarks_bigger_better.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true