88 types : [ created ]
99
1010env :
11- REFERENCE_CONFIG : ' Ubuntu gcc14' # configuration used for coverage etc
11+ REFERENCE_CONFIG : ' gcc14' # configuration used for coverage etc
1212
1313jobs :
14+ buildKeycloakDockerImage :
15+ uses : ./.github/workflows/build_keycloak_docker.yml
16+ permissions :
17+ contents : read
18+ packages : write
19+
1420 build :
21+ needs : buildKeycloakDockerImage
1522 name : " ${{ matrix.configurations.name }} | ${{ matrix.cmake-build-type }}"
1623 environment : configure coverage
17- runs-on : ${{ matrix.configurations.os }}
24+ runs-on : " ubuntu-latest"
25+ container : " ghcr.io/fair-acc/gr4-build-container:latest"
1826 strategy :
1927 fail-fast : false
2028 matrix :
2129 configurations :
22- - name : Ubuntu gcc14
23- os : ubuntu-24.04
30+ - name : gcc14
2431 compiler : gcc14
25- - name : Ubuntu clang18
26- os : ubuntu-24.04
27- compiler : clang18
28- - name : ubuntu-22.04 emscripten
29- os : ubuntu-24.04
32+ cc : gcc-14
33+ cxx : g++-14
34+ - name : clang20
35+ compiler : clang20
36+ cc : clang-20
37+ cxx : clang++-20
38+ - name : emscripten
3039 compiler : emscripten
31- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
3240 cmake-build-type : [ Release, Debug ]
3341 env :
3442 BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory
43+ services :
44+ keycloak :
45+ image : ${{ needs.buildKeycloakDockerImage.outputs.image }}
46+ env :
47+ KEYCLOAK_ADMIN : admin
48+ KEYCLOAK_ADMIN_PASSWORD : admin
3549
3650 steps :
3751 - uses : actions/checkout@v6
@@ -46,56 +60,26 @@ jobs:
4660 path : ${{runner.workspace}}/build/_deps
4761 key : ${{ runner.os }}-${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}
4862
49- - name : Install gcovr
50- shell : bash
51- if : matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
52- run : sudo apt-get install -y gcovr
53-
54- - name : Install gcc-14
55- if : matrix.configurations.compiler == 'gcc14'
56- run : |
57- sudo apt-get install -y gcc-14 g++-14
58- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 110 --slave /usr/bin/g++ g++ /usr/bin/g++-14 --slave /usr/bin/gcov gcov /usr/bin/gcov-14
59-
60- - name : Install clang-18
61- if : matrix.configurations.compiler == 'clang18'
62- run : |
63- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
64- sudo apt update
65- sudo apt upgrade -y
66- sudo apt install -y clang-18 libc++-18-dev libc++abi-18-dev
67- sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-18 110
68- sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 110
69-
70- - name : Install emscripten
71- if : matrix.configurations.compiler == 'emscripten'
72- run : |
73- cd
74- git clone https://github.com/emscripten-core/emsdk.git
75- cd emsdk
76- # Download and install emscripten.
77- ./emsdk install 3.1.59
78- # Make "active" for the current user. (writes .emscripten file)
79- ./emsdk activate 3.1.59
80-
8163 - name : Install sonar-scanner and build-wrapper
8264 if : matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
8365 uses : SonarSource/sonarqube-scan-action/install-build-wrapper@v7
8466
8567 - name : Configure CMake
8668 if : matrix.configurations.compiler != 'emscripten'
87- # Use a bash shell, so we can use the same syntax for environment variable access regardless of the host operating system
8869 shell : bash
70+ env :
71+ CC : " ${{ matrix.configurations.cc }}"
72+ CXX : " ${{ matrix.configurations.cxx }}"
73+ CMAKE_EXPORT_COMPILE_COMMANDS : " ON"
8974 run : cmake -S . -B ../build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DOPENCMW_ENABLE_COVERAGE=${{ matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug' }}
9075
9176 - name : Configure CMake Emscripten
9277 if : matrix.configurations.compiler == 'emscripten'
93- # Use a bash shell, so we can use the same syntax for environment variable access regardless of the host operating system
9478 shell : bash
9579 run : |
9680 export SYSTEM_NODE=`which node` # use system node instead of old version distributed with emsdk for threading support
97- source ~/emsdk /emsdk_env.sh
98- emcmake cmake -S . -B ../build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DENABLE_TESTING=ON - DCMAKE_CROSSCOMPILING_EMULATOR=${SYSTEM_NODE}
81+ source $EMSDK_HOME /emsdk_env.sh
82+ emcmake cmake -S . -B ../build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DCMAKE_CROSSCOMPILING_EMULATOR=${SYSTEM_NODE}
9983
10084 - name : Build
10185 if : matrix.configurations.name != env.REFERENCE_CONFIG || matrix.cmake-build-type != 'Debug'
@@ -107,14 +91,27 @@ jobs:
10791 shell : bash
10892 run : build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ../build --config ${{ matrix.cmake-build-type }}
10993
110- - name : Run Keycloak Docker
94+ - name : Setup Keycloak
95+ if : matrix.configurations.compiler != 'emscripten'
11196 shell : bash
112- run : docker run -p 8090:8080 -d -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:26.0.5 start-dev && src/client/test/setup-keycloak.sh
97+ env :
98+ KEYCLOAK_URL : http://keycloak:8080
99+ KEYCLOAK_REDIRECT_URI : http://localhost:8091
100+ KEYCLOAK_ADMIN_PASSWORD : admin
101+ run : |
102+ if ! command -v jq >/dev/null 2>&1; then
103+ sudo apt-get update
104+ sudo apt-get install -y --no-install-recommends jq
105+ fi
106+ src/client/test/setup-keycloak.sh
113107
114108 - name : Run tests
115109 if : matrix.configurations.name != env.REFERENCE_CONFIG || matrix.cmake-build-type != 'Debug'
116110 working-directory : ${{runner.workspace}}/build
117111 shell : bash
112+ env :
113+ KEYCLOAK_URL : http://keycloak:8080
114+ KEYCLOAK_REDIRECT_URI : http://localhost:8091
118115 # Execute tests defined by the CMake configuration. The coverage target runs the autodiscovered catch2 tests using
119116 # ctest and records the coverage using gcov
120117 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
@@ -124,6 +121,9 @@ jobs:
124121 if : matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
125122 working-directory : ${{runner.workspace}}/build
126123 shell : bash
124+ env :
125+ KEYCLOAK_URL : http://keycloak:8080
126+ KEYCLOAK_REDIRECT_URI : http://localhost:8091
127127 # Execute tests defined by the CMake configuration. The coverage target runs the autodiscovered catch2 tests using
128128 # ctest and records the coverage using gcov
129129 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
0 commit comments