Skip to content

Commit 8452099

Browse files
committed
feat(github):Add CI test with C++20
Add the new scheme for other tests
1 parent f6e9931 commit 8452099

8 files changed

Lines changed: 212 additions & 12 deletions

File tree

.github/actions/ctest-cdash/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runs:
2121
run: |
2222
echo "TEST_MODEL=Experimental" >> $GITHUB_ENV
2323
export PULL_NR=${{ github.event.number }}
24-
echo "TEST_NAME=\"${{ inputs.repo }}_${{ matrix.os }}_${{ matrix.fsv }} (pull request No.${PULL_NR})\"" >> $GITHUB_ENV
24+
echo "TEST_NAME=\"${{ inputs.repo }}_cpp${{ matrix.cpp }}_${{ matrix.os }}_${{ matrix.fsv }} (pull request No.${PULL_NR})\"" >> $GITHUB_ENV
2525
shell: bash
2626

2727
- name: running ctest

.github/actions/pre-build/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ runs:
88
run: |
99
git config --global --add safe.directory $GITHUB_WORKSPACE
1010
echo "UCESB_DIR=$GITHUB_WORKSPACE/ucesb/" >> $GITHUB_ENV
11-
export SIMPATH=${CVMDIR}/${{ matrix.os }}/fairsoft/${{ matrix.fsv }}
12-
echo "SIMPATH=${SIMPATH}" >> $GITHUB_ENV
13-
echo "FAIRROOTPATH=${CVMDIR}/${{ matrix.os }}/fairroot/v18.8.2_${{ matrix.fsv }}" >> $GITHUB_ENV
14-
echo "${SIMPATH}/bin" >> $GITHUB_PATH
11+
if [ "${{ matrix.cpp }}" == "20" ]; then
12+
export SIMPATH=${CVMDIR}/${{ matrix.os }}/fairsoft/cpp20/${{ matrix.fsv }}
13+
echo "SIMPATH=${SIMPATH}" >> $GITHUB_ENV
14+
echo "FAIRROOTPATH=${CVMDIR}/${{ matrix.os }}/fairroot/cpp20/v18.8.2_${{ matrix.fsv }}" >> $GITHUB_ENV
15+
echo "${SIMPATH}/bin" >> $GITHUB_PATH
16+
else
17+
export SIMPATH=${CVMDIR}/${{ matrix.os }}/fairsoft/${{ matrix.fsv }}
18+
echo "SIMPATH=${SIMPATH}" >> $GITHUB_ENV
19+
echo "FAIRROOTPATH=${CVMDIR}/${{ matrix.os }}/fairroot/v18.8.2_${{ matrix.fsv }}" >> $GITHUB_ENV
20+
echo "${SIMPATH}/bin" >> $GITHUB_PATH
21+
fi
1522
# variables for ccache
1623
echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
1724
echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> $GITHUB_ENV

.github/workflows/main-nightly-sim.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ jobs:
6666
# r3broot. Each group is used by only one job.
6767
repos: [ r3broot, glad-tpc, sofia-frs-asy ]
6868
os: [ debian11, debian12 ] # ubuntu24.04 ]
69-
fsv: [jan24p1, jan24p5]
70-
69+
fsv: [ jan24p1, jan24p5 ]
70+
cpp: [ 17 ]
71+
7172
# The list under "include" defines some properties for each group:
7273
#
7374
# repos: the name of the group. It must exist in matrix.repos as

.github/workflows/main-nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
# r3broot. Each group is used by only one job.
6767
repos: [ r3broot, glad-tpc, sofia-frs-asy ]
6868
os: [ debian11, debian12 ] # ubuntu24.04 ]
69-
fsv: [jan24p1, jan24p5]
69+
fsv: [ jan24p1, jan24p5 ]
70+
cpp: [ 17 ]
7071

7172
# The list under "include" defines some properties for each group:
7273
#

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
# r3broot. Each group is used by only one job.
9494
repos: [ r3broot, glad-tpc, sofia-frs-asy, r3broot-conan ]
9595
os: [ debian10, debian11, debian12 ]
96-
fsv: [jan24p1]
96+
fsv: [ jan24p1 ]
97+
cpp: [ 17 ]
9798

9899
# The list under "include" defines some properties for each group:
99100
#

.github/workflows/maincpp20.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# This is the main CI workflow for pull requests to the R3BRoot dev branch.
2+
#
3+
# SPDX-License-Identifier: LGPL-3.0-or-later
4+
5+
name: CI-CD-C++20
6+
7+
# Controls when the action will run.
8+
on:
9+
# Triggers the workflow in case of a push or pull request events
10+
push:
11+
branches: [ dev ]
12+
pull_request:
13+
branches: [ dev ]
14+
schedule:
15+
- cron: '0 21 * * 1'
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
# A workflow run is made up of one or more jobs that can run sequentially or
21+
# parallelly. As has been specified above, all the jobs below will be
22+
# triggered either by a pull request or a merge of a pull request.
23+
jobs:
24+
# The job to clean the old caches before new caches are created when the PR is merged.
25+
cache-cleanup:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
submodules: 'true'
32+
- name: clean-cache
33+
if: github.event_name == 'push'
34+
uses: './.github/actions/cache-clean'
35+
with:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
# The job to run the main CI pipelines
39+
build-test:
40+
needs: cache-cleanup
41+
runs-on: ubuntu-latest
42+
# A strategy matrix gives different settings separately to different jobs
43+
# which are run parallelly.
44+
strategy:
45+
# If fail-fast is true, all jobs running parallelly will be stopped if
46+
# any of them fail. By setting it to false, all jobs will be run
47+
# undisruptively.
48+
fail-fast: false
49+
# Definition of the strategy matrix. See
50+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow
51+
matrix:
52+
# Here are the groups of repositories that need to be downloaded inside
53+
# r3broot. Each group is used by only one job.
54+
repos: [ r3broot, glad-tpc, sofia-frs-asy, r3broot-conan ]
55+
os: [ debian12 ]
56+
fsv: [ jan24p5 ]
57+
cpp: [ 20 ]
58+
59+
# The list under "include" defines some properties for each group:
60+
#
61+
# repos: the name of the group. It must exist in matrix.repos as
62+
# defined above.
63+
#
64+
# cache: the name of the cache file that will be created/used for the
65+
# job. Each group can have their own cache file. But the total size of
66+
# the cache files are limited to 10 GB per project. Therefore, the
67+
# number of caches should be kept to a minimum. If there isn't too
68+
# much difference between glad-tpc and the base r3broot, the cache file
69+
# generated from r3broot build can be used.
70+
#
71+
# skip-save: whether to save the cache or not. Cache saving is disabled
72+
# when true. This is neccessary when two parellel jobs share one cache
73+
# name.
74+
#
75+
# url: the github repository urls that need to be downloaded during the
76+
# run
77+
include:
78+
# The R3BFileSource repo is used for testing unpacking.
79+
- url: https://github.com/R3BRootGroup/R3BFileSource.git
80+
- cache: r3broot
81+
# disable conan build by default
82+
- preset: simple
83+
84+
# This job is only for testing R3BRoot without downloading any
85+
# dependencies.
86+
- repos: r3broot
87+
# The job for testing with glad-tpc
88+
- repos: glad-tpc
89+
url: https://github.com/R3BRootGroup/glad-tpc.git
90+
cache: glad-tpc
91+
# skip-save: true
92+
# The job for testing with sofia, frs and asyeos dependencies. All three
93+
# repositories are downloaded and run together in the job.
94+
- repos: sofia-frs-asy
95+
# If more than one repos needs to be downloaded in a job. "url" needs
96+
# to be a space separated list of urls using the operator ">-". Append
97+
# more urls to this list if more repos need to be added.
98+
# The R3BFileSource repo is used for testing unpacking.
99+
url: >-
100+
https://github.com/R3BRootGroup/sofia.git
101+
https://github.com/R3BRootGroup/frs.git
102+
https://github.com/R3BRootGroup/asyeos.git
103+
https://github.com/R3BRootGroup/R3BFileSource.git
104+
# Using own cache file
105+
cache: other-repos
106+
107+
# build with conan package manager
108+
- repos: r3broot-conan
109+
preset: default
110+
111+
# Jobs are run inside a Docker container, which provides different compiled
112+
# tool-kits for the building, such as clang-tidy and cvmfs. For more
113+
# information, please visit the Docker repository at Dockerhub.
114+
container:
115+
image: yanzhaowang/cvmfs_clang:${{ matrix.os }}
116+
volumes:
117+
- /tmp:/cvmfs
118+
env:
119+
CVMDIR: /cvmfs/fairsoft.gsi.de
120+
# Specifying the number of threads available for the building and
121+
# testing. Github hosted runners can have at most 4 cores. The number
122+
# of the cores can be increased with a larger runner, thus increasing
123+
# the speed of the run.
124+
NUM_THREADS: 4
125+
# Options for the Docker container to be run with cvmfs.
126+
options: --user root --privileged --ulimit nofile=10000:10000 --cap-add SYS_ADMIN --device /dev/fuse
127+
128+
# Each job contains different steps that are executed sequentially. Each
129+
# step could be multiple shell commands or a composite action either from
130+
# another github repo or a self-defined one in .github/actions.
131+
steps:
132+
# Fetch updates from pull request branches using a public github action.
133+
- uses: actions/checkout@v4
134+
with:
135+
# This allows all commits of all branches to be fetched.
136+
fetch-depth: 0
137+
138+
# A self-defined composite action. It sets multiple necessary environment
139+
# variables and mounts the cmvfs folder of fairroot and fairsoft.
140+
- name: pre-build
141+
uses: './.github/actions/pre-build'
142+
143+
# A self-defined composite action, which restores the caches of
144+
# dependencies and builds and install them if the cache doesn't exist.
145+
# The two inputs for this action, r3b-dev-key and cache-name, determine
146+
# the name (key) of the R3BRoot build cache being used in the the run.
147+
# Its name is defined as
148+
# "r3b-build-${cache-name}-${r3b-dev-key}". Apart from r3b build cache,
149+
# there is another cache called "r3b-build-deps", which contains all
150+
# dependencies for the R3BRoot build, such as googletest and ucesb. The
151+
# cache restoring step is only used for the run triggered with
152+
# "pull_request" and disabled for the merge event.
153+
- name: install dependencies
154+
id: restore-cache
155+
uses: './.github/actions/install-deps'
156+
with:
157+
cache-name: ${{ matrix.cache }}
158+
159+
# A self-defined composite action for the cmake configuration and build
160+
# of r3broot (along with necessary dep repos).
161+
- name: configure-build
162+
uses: './.github/actions/r3bbuild-steps'
163+
164+
# A self-defined composite action to perform the ctest and push the
165+
# results to the cdash (cmake-dashborad). To fully show the errors and
166+
# warnings during the configure and build processes, the two processes
167+
# are rerun after 'make clean'.
168+
- name: ctest-cdash
169+
if: always()
170+
uses: './.github/actions/ctest-cdash'
171+
with:
172+
repo: ${{ matrix.repos }}
173+
174+
# A composite action to save the ccaahe created from the merge events.
175+
# Cache names (key) should be consistent with the names used in the
176+
# cache restoring step.
177+
- name: save-cache
178+
if: github.event_name == 'push' && matrix.skip-save != true
179+
id: save-cache
180+
uses: './.github/actions/cache-save'
181+
with:
182+
cache-name: ${{ matrix.cache }}
183+
r3b-dev-key: ${{ env.cacheSHA }}
184+
185+
# Show the cache hit rate from ccache.
186+
- name: ccache stats
187+
if: github.event_name == 'pull_request' && always()
188+
run: ccache --show-stats

.github/workflows/static_analysis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
matrix:
3434
preset: [ default ]
3535
os: [ debian12 ]
36-
fsv: [jan24p1]
36+
fsv: [ jan24p1 ]
37+
cpp: [ 17 ]
3738
container:
3839
image: yanzhaowang/cvmfs_clang:${{ matrix.os }}
3940
volumes:

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ The following systems are tested regularly.
102102
| RHEL | x86\_64 | 9.6 | GCC 14.2.0 | 3.30.6 | C++17 |
103103
| Debian | x86\_64 | 10 | GCC 8.3.0 | 3.27.4 / 4.0.3 | C++17 |
104104
| Debian | x86\_64 | 11 | GCC 10.2.1 | 3.27.4 / 3.30.0 | C++17 |
105-
| Debian | x86\_64 | 12 | GCC 12.2.0 | 3.27.4 / 3.30.0 | C++17 |
106-
| Ubuntu | x86\_64 | 24.04 | GCC 13.3.0 | 3.28.3 / 4.0.3 | C++17 |
105+
| Debian | x86\_64 | 12 | GCC 12.2.0 | 3.27.4 / 3.30.0 | C++17 / C++20 |
106+
| Ubuntu | x86\_64 | 24.04 | GCC 13.3.0 | 3.28.3 / 4.0.3 | C++17 / C++20 |
107+
| macOS | arm64 | 15.3 | AppleClang 15 | 4.0.3 | C++17 |
107108

108109
## Security Policy
109110

0 commit comments

Comments
 (0)