diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 487e5415..a273422b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022] #macos-14, + os: [ubuntu-22.04, macos-14, windows-2022] sofa_branch: [master] steps: @@ -114,63 +114,17 @@ jobs: name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_ARTIFACT_PATH }} - - name: Set env vars for tests - shell: bash - run: | - # Set env vars for tests - if [[ "$RUNNER_OS" == "Windows" ]]; then - echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH - echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH - echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin;$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/bin" | tee -a $GITHUB_ENV - else - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/lib" | tee -a $GITHUB_ENV - fi - - if [[ "$RUNNER_OS" == "macOS" ]]; then - echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV - fi - - if [[ "$RUNNER_OS" == "Linux" ]]; then - echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV - fi - - # - 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_INSTALL_PATH" ------' - # ls -la "$WORKSPACE_INSTALL_PATH" - # echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------' - # ls -la "$WORKSPACE_ARTIFACT_PATH" - # echo '----------------------' - # echo "SOFA_ROOT = $SOFA_ROOT" - - - name: Fetch, install and run Regression_test - id: regression-test - if: always() - shell: bash - run: | - if [[ "$RUNNER_OS" != "macOS" ]]; then - # Get regression from github releases - mkdir -p "${{ runner.temp }}/regression_tmp/install" - curl --output "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -L https://github.com/sofa-framework/regression/releases/download/release-master/Regression_test_master_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${RUNNER_OS}.zip - unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install" - # Install it in the SOFA bin directory - $SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin" - chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} - # Setup mandatory env vars - export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/scenes" - export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references" - export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages - # Run regression test bench - ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} - else - echo "Regression tests are not supported on the CI for macOS yet (TODO)" - fi + - name: Launch test + id: tests + uses: sofa-framework/sofa-test-action@v1.0 + with: + sofa_root: ${{ github.workspace }}/sofa + sofa_version: ${{ steps.sofa.outputs.sofa_version }} + src_dir: ${{ env.WORKSPACE_SRC_PATH }} + build_dir: ${{ env.WORKSPACE_BUILD_PATH }} + python_exe: ${{ steps.sofa.outputs.python_exe }} + output_dir: ${{ github.workspace }}/tests-results_dir + nb_parallel_threads: '4' deploy: name: Deploy artifacts diff --git a/scenes/NeedleInsertion.py b/examples/NeedleInsertion.py similarity index 100% rename from scenes/NeedleInsertion.py rename to examples/NeedleInsertion.py diff --git a/scenes/NeedleInsertionCycles.py b/examples/NeedleInsertionCycles.py similarity index 100% rename from scenes/NeedleInsertionCycles.py rename to examples/NeedleInsertionCycles.py diff --git a/scenes/NeedleInsertionHaptics.py b/examples/NeedleInsertionHaptics.py similarity index 100% rename from scenes/NeedleInsertionHaptics.py rename to examples/NeedleInsertionHaptics.py diff --git a/scenes/RecordState/NeedleInsertion.txt b/examples/RecordState/NeedleInsertion.txt similarity index 100% rename from scenes/RecordState/NeedleInsertion.txt rename to examples/RecordState/NeedleInsertion.txt diff --git a/scenes/RecordState/NeedleInsertionCycles.txt b/examples/RecordState/NeedleInsertionCycles.txt similarity index 100% rename from scenes/RecordState/NeedleInsertionCycles.txt rename to examples/RecordState/NeedleInsertionCycles.txt diff --git a/scenes/RecordState/NeedleInsertionHaptics.txt b/examples/RecordState/NeedleInsertionHaptics.txt similarity index 100% rename from scenes/RecordState/NeedleInsertionHaptics.txt rename to examples/RecordState/NeedleInsertionHaptics.txt diff --git a/scenes/RegressionStateScenes.regression-tests b/examples/RegressionStateScenes.regression-tests similarity index 100% rename from scenes/RegressionStateScenes.regression-tests rename to examples/RegressionStateScenes.regression-tests