Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] port v23.12 ci modifications #25

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 10 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Loading