From ff5564be2b77d2e007b711d908570af449bcd820 Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 6 Nov 2026 17:52:04 +0100 Subject: [PATCH] moved most gitea workflows to github --- .gitea/workflows/docker-rh8-build-test.yml | 44 -------------- .gitea/workflows/docker-rh9-build-test.yml | 41 ------------- .gitea/workflows/rh8-local-tests.yml | 58 ------------------- .gitea/workflows/rh9-local-build-deploy.yml | 29 ---------- .gitea/workflows/rh9-local-tests.yml | 49 ---------------- .github/workflows/rh8-local-tests.yaml | 7 +++ .../workflows/rh8-nfs-deploy.yaml | 4 +- .github/workflows/rh9-local-tests.yaml | 7 ++- .github/workflows/rh9-nfs-deploy.yaml | 0 .github/workflows/run_tests.yaml | 13 +---- 10 files changed, 17 insertions(+), 235 deletions(-) delete mode 100644 .gitea/workflows/docker-rh8-build-test.yml delete mode 100644 .gitea/workflows/docker-rh9-build-test.yml delete mode 100644 .gitea/workflows/rh8-local-tests.yml delete mode 100644 .gitea/workflows/rh9-local-build-deploy.yml delete mode 100644 .gitea/workflows/rh9-local-tests.yml rename .gitea/workflows/rh8-local-build-deploy.yml => .github/workflows/rh8-nfs-deploy.yaml (89%) create mode 100644 .github/workflows/rh9-nfs-deploy.yaml diff --git a/.gitea/workflows/docker-rh8-build-test.yml b/.gitea/workflows/docker-rh8-build-test.yml deleted file mode 100644 index 9bb09949b..000000000 --- a/.gitea/workflows/docker-rh8-build-test.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build on RHEL8 docker image - -on: - push: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: "ubuntu-latest" - container: - image: gitea.psi.ch/detectors/rhel8-detectors-dev - steps: - - name: Clone repository - run: | - git lfs install --skip-smudge - echo Cloning ${{ github.ref_name }} - git clone https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git --branch=${{ github.ref_name }} . - - - name: Build library - run: | - mkdir build && cd build - cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON -DSLS_USE_MATTERHORN=ON - make -j 2 - - - name: C++ unit tests - working-directory: ${{gitea.workspace}}/build - run: ctest -j1 --rerun-failed --output-on-failure - - - name: Install Python dependencies - run: | - python3.12 -m pip install --upgrade pip - python3.12 -m pip install pytest - python3.12 -m pip install colorama - python3.12 -m pip install numpy - python3.12 -m pip install pyzmq - - - name: Python unit tests - working-directory: ${{gitea.workspace}} - run: | - export PYTHONPATH=$PWD/build/bin:$PYTHONPATH - python3.12 -m pytest python/tests \ No newline at end of file diff --git a/.gitea/workflows/docker-rh9-build-test.yml b/.gitea/workflows/docker-rh9-build-test.yml deleted file mode 100644 index 7d2fbb400..000000000 --- a/.gitea/workflows/docker-rh9-build-test.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build on RHEL9 docker image - -on: - push: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: "ubuntu-latest" - container: - image: gitea.psi.ch/detectors/rhel9-detectors-dev - steps: - - uses: actions/checkout@v4 - - - - name: Build library - run: | - mkdir build && cd build - cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON -DSLS_USE_MATTERHORN=ON - make -j 2 - - - name: C++ unit tests - working-directory: ${{gitea.workspace}}/build - run: ctest -j1 --rerun-failed --output-on-failure - - - name: Install Python dependencies - run: | - python3.12 -m pip install --upgrade pip - python3.12 -m pip install pytest - python3.12 -m pip install colorama - python3.12 -m pip install numpy - python3.12 -m pip install pyzmq - - - name: Python unit tests - working-directory: ${{gitea.workspace}} - run: | - export PYTHONPATH=$PWD/build/bin:$PYTHONPATH - python3.12 -m pytest python/tests \ No newline at end of file diff --git a/.gitea/workflows/rh8-local-tests.yml b/.gitea/workflows/rh8-local-tests.yml deleted file mode 100644 index d76ad3588..000000000 --- a/.gitea/workflows/rh8-local-tests.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Run Simulator Tests on local RHEL8 - -on: - #push: - workflow_dispatch: - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Debug - - -jobs: - build: - runs-on: "detectors-software-RH8" - steps: - - uses: actions/checkout@v4 - - - name: Configure CMake - run: | - source /home/gitea_runner/.bashrc - conda activate det - cmake -B build \ - -DCMAKE_BUILD_TYPE=Debug \ - -DSLS_USE_TESTS=ON \ - -DSLS_USE_SIMULATOR=ON \ - -DSLS_USE_PYTHON=On \ - -DSLS_USE_HDF5=ON - - - name: Build - # Build your program with the given configuration - run: | - source /home/gitea_runner/.bashrc - conda activate det - cmake --build build -j4 --config Debug - - - name: Python unit tests with simulators - run: | - source /home/gitea_runner/.bashrc - conda activate det - export PYTHONPATH=$PWD/build/bin:$PYTHONPATH - export SLSDETNAME=gitea_runner_tests - python -m pytest -m detectorintegration python/tests --detector-integration - python -m pytest python/tests - - - - name: Simulator unit tests - run: | - source /home/gitea_runner/.bashrc - conda activate det - cd build/bin - python test_simulators.py -g - - - name: Run frame synchronizer tests - run: | - source /home/gitea_runner/.bashrc - conda activate det - cd build/bin - python test_frame_synchronizer.py diff --git a/.gitea/workflows/rh9-local-build-deploy.yml b/.gitea/workflows/rh9-local-build-deploy.yml deleted file mode 100644 index 94db2a2ec..000000000 --- a/.gitea/workflows/rh9-local-build-deploy.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build and Deploy on local RHEL9 - -on: - push: - branches: - - developer - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: "detectors-software-RH9" - steps: - - uses: actions/checkout@v4 - - - name: Build library - run: | - mkdir build && cd build - cmake -DSLS_USE_PYTHON=ON -DPython_EXECUTABLE=/usr/bin/python3.13 -DPython_INCLUDE_DIR=/usr/include/python3.13 -DPython_LIBRARY=/usr/lib64/libpython3.13.so -DSLS_USE_SIMULATOR=ON -DSLS_USE_GUI=ON .. - make -j 2 - - - name: Deploy to NFS update server - if: gitea.ref == 'refs/heads/developer' - run: | - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin' - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put pyctbgui' - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer' \ No newline at end of file diff --git a/.gitea/workflows/rh9-local-tests.yml b/.gitea/workflows/rh9-local-tests.yml deleted file mode 100644 index 2871a024f..000000000 --- a/.gitea/workflows/rh9-local-tests.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Run Simulator Tests on local RHEL9 - -on: - #push: - workflow_dispatch: - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Debug - - -jobs: - build: - runs-on: "detectors-software-RH9" - steps: - - uses: actions/checkout@v4 - - - name: Configure CMake - run: | - cmake -B build \ - -DCMAKE_BUILD_TYPE=Debug \ - -DSLS_USE_TESTS=ON \ - -DSLS_USE_SIMULATOR=ON \ - -DSLS_USE_PYTHON=On \ - -DPython_EXECUTABLE=/usr/bin/python3.13 \ - -DPython_INCLUDE_DIR=/usr/include/python3.13 \ - -DPython_LIBRARY=/usr/lib64/libpython3.13.so \ - -DSLS_USE_HDF5=ON - - - name: Build - # Build your program with the given configuration - run: cmake --build build -j4 --config Debug - - - name: Python unit tests with simulators - run: | - export PYTHONPATH=$PWD/build/bin:$PYTHONPATH - export SLSDETNAME=gitea_runner_tests - python3.13 -m pytest -m detectorintegration python/tests --detector-integration - python3.13 -m pytest python/tests - - - name: Simulator unit tests - run: | - cd build/bin - python3.13 test_simulators.py -g - - - name: Run frame synchronizer tests - run: | - cd build/bin - python3.13 test_frame_synchronizer.py diff --git a/.github/workflows/rh8-local-tests.yaml b/.github/workflows/rh8-local-tests.yaml index b84f94c9b..9b79f80ef 100644 --- a/.github/workflows/rh8-local-tests.yaml +++ b/.github/workflows/rh8-local-tests.yaml @@ -33,6 +33,13 @@ jobs: conda activate det cmake --build build -j4 --config Debug + - name: C++ unit tests + run: | + source /home/github_runner/.bashrc + conda activate det + cd build + ctest -j1 --rerun-failed --output-on-failure + - name: Python unit tests with simulators run: | source /home/github_runner/.bashrc diff --git a/.gitea/workflows/rh8-local-build-deploy.yml b/.github/workflows/rh8-nfs-deploy.yaml similarity index 89% rename from .gitea/workflows/rh8-local-build-deploy.yml rename to .github/workflows/rh8-nfs-deploy.yaml index 120605dac..2d275dc0c 100644 --- a/.gitea/workflows/rh8-local-build-deploy.yml +++ b/.github/workflows/rh8-nfs-deploy.yaml @@ -17,7 +17,7 @@ jobs: - name: Build library run: | - source /home/gitea_runner/.bashrc + source /home/github_runner/.bashrc conda activate det mkdir build && cd build conda activate det @@ -25,7 +25,7 @@ jobs: make -j 2 - name: Deploy to NFS update server - if: gitea.ref == 'refs/heads/developer' + 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' diff --git a/.github/workflows/rh9-local-tests.yaml b/.github/workflows/rh9-local-tests.yaml index e196372b5..9671df226 100644 --- a/.github/workflows/rh9-local-tests.yaml +++ b/.github/workflows/rh9-local-tests.yaml @@ -1,7 +1,7 @@ name: Run Simulator Tests on local RHEL9 on: - push: # change to pull_request + pull_request: workflow_dispatch: env: @@ -31,6 +31,11 @@ jobs: # Build your program with the given configuration run: cmake --build build -j4 --config Debug + - name: C++ unit tests + run: | + cd build + ctest -j1 --rerun-failed --output-on-failure + - name: Python unit tests with simulators run: | export PYTHONPATH=$PWD/build/bin:$PYTHONPATH diff --git a/.github/workflows/rh9-nfs-deploy.yaml b/.github/workflows/rh9-nfs-deploy.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 90bf980be..23286a6d8 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -1,4 +1,4 @@ -name: Run Simulator Tests +name: Run Unit Tests on: push: @@ -37,19 +37,10 @@ jobs: - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build -j4 --config ${{env.BUILD_TYPE}} - - - name: Simulator unit tests - working-directory: ${{github.workspace}}/build/bin - run: | - python test_simulators.py --no-log-file --quiet --tests "[detectorintegration]~[disable_check_data_file]" - #remove --quiet to see more prints from simulator, receiver and tests - python test_frame_synchronizer.py - - - name: Python unit tests with simulators + - name: Python unit tests working-directory: ${{github.workspace}}/build/bin run: | - python -m pytest -m detectorintegration ${{github.workspace}}/python/tests --detector-integration python -m pytest ${{github.workspace}}/python/tests - name: C++ unit tests