From 438a265d7ec899dab4ccd2ef49b34386da9db99c Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Wed, 11 Nov 2026 16:38:13 +0100 Subject: [PATCH] 1010/Fix/nfs deploy workflows (#1672) (#1673) * dev/Fix/nfs deploy workflows (#1672) * reset udp streaming for all modules * Revert "reset udp streaming for all modules" This reverts commit e0d0a13deff45af7431f388f2eff7897b46ccaee. * fixed nfs upload workflows * only build on push * execute workflows on push for testing * temporarily disable local tests * forgot to commit * also upload if not push to developer for testing * reverted testing mode * fixed shared memory test * Refactor SharedMemory test by removing Apple checks Removed platform-specific code for Apple from SharedMemory test. --- .github/workflows/cmake.yaml | 4 ++-- .github/workflows/rh8-local-tests.yaml | 5 +++++ .github/workflows/rh8-nfs-deploy.yaml | 6 +++--- .github/workflows/rh9-local-tests.yaml | 4 ++++ .github/workflows/rh9-nfs-deploy.yaml | 1 - slsDetectorSoftware/tests/test-SharedMemory.cpp | 5 ++++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yaml b/.github/workflows/cmake.yaml index d1e3503a8..c32386fb8 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/cmake.yaml @@ -1,7 +1,7 @@ name: Native CMake Build -on: [push, pull_request] - +on: [push, workflow_dispatch] + env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug diff --git a/.github/workflows/rh8-local-tests.yaml b/.github/workflows/rh8-local-tests.yaml index c4eb0aabc..6c5a66bf4 100644 --- a/.github/workflows/rh8-local-tests.yaml +++ b/.github/workflows/rh8-local-tests.yaml @@ -4,6 +4,11 @@ on: pull_request: workflow_dispatch: +# Cancel older runs of this workflow for the same PR/branch when a new push arrives +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug diff --git a/.github/workflows/rh8-nfs-deploy.yaml b/.github/workflows/rh8-nfs-deploy.yaml index 3b7ec7b5a..08afc01d3 100644 --- a/.github/workflows/rh8-nfs-deploy.yaml +++ b/.github/workflows/rh8-nfs-deploy.yaml @@ -29,6 +29,6 @@ jobs: - name: Deploy to NFS update server if: github.ref == 'refs/heads/developer' run: | - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put pyctbgui' - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer' \ No newline at end of file + cp -r build/bin /home/github_runner/slsDetectorSoftware/RH8 + cp slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer /home/github_runner/slsDetectorSoftware/RH8 + cp -r pyctbgui /home/github_runner/slsDetectorSoftware/RH8 \ No newline at end of file diff --git a/.github/workflows/rh9-local-tests.yaml b/.github/workflows/rh9-local-tests.yaml index 9671df226..38ff6fea1 100644 --- a/.github/workflows/rh9-local-tests.yaml +++ b/.github/workflows/rh9-local-tests.yaml @@ -4,6 +4,10 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug diff --git a/.github/workflows/rh9-nfs-deploy.yaml b/.github/workflows/rh9-nfs-deploy.yaml index cae4a5056..1be05fa70 100644 --- a/.github/workflows/rh9-nfs-deploy.yaml +++ b/.github/workflows/rh9-nfs-deploy.yaml @@ -18,7 +18,6 @@ jobs: - name: Build library run: | mkdir build && cd build - conda activate det cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_SIMULATOR=ON -DSLS_USE_GUI=ON make -j 2 cd ../pyctbgui diff --git a/slsDetectorSoftware/tests/test-SharedMemory.cpp b/slsDetectorSoftware/tests/test-SharedMemory.cpp index f9b7ce16f..b102f5727 100644 --- a/slsDetectorSoftware/tests/test-SharedMemory.cpp +++ b/slsDetectorSoftware/tests/test-SharedMemory.cpp @@ -38,9 +38,12 @@ void freeShm(const int dindex, const int mIndex) { } constexpr int shm_id = 10; + +const char *env_p = std::getenv(SHM_ENV_NAME); +std::string env_name = env_p ? ("_" + std::string(env_p)) : ""; const std::string file_path = std::string("/dev/shm/slsDetectorPackage_detector_") + - std::to_string(shm_id); + std::to_string(shm_id) + env_name; TEST_CASE("Free obsolete (without isValid)", "[detector][shm]") {