From 6e4db45b578c7e87c577783ee639ffc89c2d11d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Thu, 10 Apr 2025 10:17:16 +0200 Subject: [PATCH] Activated RH8 build on PSI gitea (#155) --- .gitea/workflows/rh8-native.yml | 12 +++++++++--- .gitea/workflows/rh9-native.yml | 2 +- CMakeLists.txt | 8 ++++++++ python/CMakeLists.txt | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/rh8-native.yml b/.gitea/workflows/rh8-native.yml index 02d3dc0..1c64161 100644 --- a/.gitea/workflows/rh8-native.yml +++ b/.gitea/workflows/rh8-native.yml @@ -1,18 +1,24 @@ name: Build on RHEL8 on: + push: workflow_dispatch: permissions: contents: read jobs: - buildh: + build: runs-on: "ubuntu-latest" container: image: gitea.psi.ch/images/rhel8-developer-gitea-actions steps: - - uses: actions/checkout@v4 + # workaround until actions/checkout@v4 is available for RH8 + # - uses: actions/checkout@v4 + - name: Clone repository + run: | + echo Cloning ${{ github.ref_name }} + git clone https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git --branch=${{ github.ref_name }} . - name: Install dependencies @@ -22,7 +28,7 @@ jobs: - name: Build library run: | mkdir build && cd build - cmake .. -DAARE_PYTHON_BINDINGS=ON -DAARE_TESTS=ON + cmake .. -DAARE_PYTHON_BINDINGS=ON -DAARE_TESTS=ON -DPython_FIND_VIRTUALENV=FIRST make -j 2 - name: C++ unit tests diff --git a/.gitea/workflows/rh9-native.yml b/.gitea/workflows/rh9-native.yml index c1f10ac..5027365 100644 --- a/.gitea/workflows/rh9-native.yml +++ b/.gitea/workflows/rh9-native.yml @@ -8,7 +8,7 @@ permissions: contents: read jobs: - buildh: + build: runs-on: "ubuntu-latest" container: image: gitea.psi.ch/images/rhel9-developer-gitea-actions diff --git a/CMakeLists.txt b/CMakeLists.txt index 6db9314..039545e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,14 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +message(STATUS "Building from git hash: ${GIT_HASH}") + if (${CMAKE_VERSION} VERSION_GREATER "3.24") cmake_policy(SET CMP0135 NEW) #Fetch content download timestamp endif() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 09de736..75847a7 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,12 +1,13 @@ find_package (Python 3.10 COMPONENTS Interpreter Development REQUIRED) +set(PYBIND11_FINDPYTHON ON) # Needed for RH8 # Download or find pybind11 depending on configuration if(AARE_FETCH_PYBIND11) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.13.0 + GIT_TAG v2.13.6 ) FetchContent_MakeAvailable(pybind11) else()