From af5e439eb81a84a49fb8421ef348faeaad56ba4e Mon Sep 17 00:00:00 2001 From: bakpaul Date: Mon, 8 Apr 2024 11:56:52 +0200 Subject: [PATCH] [CI] port v23.12 ci modifications --- .github/workflows/ci.yml | 35 ++++++++++------------------------- tests/CMakeLists.txt | 1 + 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51b5438..30491b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,14 @@ on: jobs: build-and-test: - name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} and python ${{ matrix.python_version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-22.04, macos-12, windows-2022] sofa_branch: [master] + python_version: ['3.10'] steps: @@ -30,7 +31,7 @@ jobs: sofa_root: ${{ github.workspace }}/sofa sofa_version: ${{ matrix.sofa_branch }} sofa_scope: 'standard' - sofa_with_sofapython3: 'true' + python_version: '${{ matrix.python_version }}' - name: Install SoftRobots shell: bash @@ -58,7 +59,10 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="$WORKSPACE_INSTALL_PATH" \ -DCMAKE_PREFIX_PATH="$SOFA_ROOT/lib/cmake" \ - " + -DSOFTROBOTS_BUILD_TESTS=True \ + -DSOFTROBOTS_IGNORE_ERRORS=True \ + -DPYTHON_ROOT=$PYTHON_ROOT -DPython_ROOT=$PYTHON_ROOT \ + -DPYTHON_EXECUTABLE=$PYTHON_EXE -DPython_EXECUTABLE=$PYTHON_EXE" if [ -e "$(command -v ccache)" ]; then cmake_options="$cmake_options -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" fi @@ -112,36 +116,17 @@ jobs: # Add execution right on the tests chmod +x $WORKSPACE_BUILD_PATH/bin/*_test${{ steps.sofa.outputs.exe }} - - name: Check environment for tests - shell: bash - run: | - echo '------ ls -la "$WORKSPACE_SRC_PATH" ------' - ls -la "$WORKSPACE_SRC_PATH" - echo '------ ls -la "$WORKSPACE_BUILD_PATH" ------' - ls -la "$WORKSPACE_BUILD_PATH" - echo '------ ls -la "$WORKSPACE_BUILD_PATH/bin" ------' - ls -la "$WORKSPACE_BUILD_PATH/bin" - echo '------ ls -la "$WORKSPACE_BUILD_PATH/tests" ------' - ls -la "$WORKSPACE_BUILD_PATH/tests" - echo '------ ls -la "$WORKSPACE_INSTALL_PATH" ------' - ls -la "$WORKSPACE_INSTALL_PATH" - echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------' - ls -la "$WORKSPACE_ARTIFACT_PATH" - echo '----------------------' - echo "SOFA_ROOT = $SOFA_ROOT"= - echo '----------------------' - python -c "import sys; print('sys.version = ' + str(sys.version)); print('sys.path = ' + str(sys.path))" - - name: Run tests if: always() shell: bash run: | + chmod +x $WORKSPACE_BUILD_PATH/bin/SoftRobots.Inverse_test${{ steps.sofa.outputs.exe }} cd $WORKSPACE_BUILD_PATH ./bin/SoftRobots.Inverse_test${{ steps.sofa.outputs.exe }} deploy: name: Deploy artifacts - if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR) + if: always() && startsWith(github.repository, 'SofaDefrost') && (startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/')) # we are not on a fork and on a branch or a tag (not a PR) needs: [build-and-test] runs-on: ubuntu-latest continue-on-error: true @@ -188,7 +173,7 @@ jobs: name: ${{ env.RELEASE_NAME }} tag_name: ${{ env.RELEASE_TAGNAME }} fail_on_unmatched_files: false - target_commitish: ${{ env.RELEASE_NAME }} + target_commitish: ${{ github.sha }} body: | Last updated on ${{ env.RELEASE_DATE }} files: | diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d4b6389..32f1e0d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,6 +11,7 @@ set(HEADER_FILES ) include(component/constraint/ConstraintTest.cmake) include(component/solver/SolverTest.cmake) +find_package(Sofa.Testing) add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${RC_FILES}) target_include_directories(${PROJECT_NAME} PRIVATE "${SoftRobots_INCLUDE_DIRS}")