diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a1dca05..1b1ff95b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,73 +84,18 @@ 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" | tee -a $GITHUB_ENV - else - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV - fi - - if [[ "$RUNNER_OS" == "macOS" ]]; then - echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/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:$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: Run BeamAdapter_test - id: unit-test - if: always() - shell: bash - run: | - chmod +x $WORKSPACE_BUILD_PATH/bin/BeamAdapter_test${{ steps.sofa.outputs.exe }} - cd $WORKSPACE_BUILD_PATH - ./bin/BeamAdapter_test${{ steps.sofa.outputs.exe }} - - - 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_${{ matrix.sofa_branch }}_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}/examples" - 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' - name: Notify dashboard if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master @@ -159,8 +104,7 @@ jobs: shell: bash run: | - test_status=$([ '${{ steps.unit-test.outcome }}' == 'success' ] && \ - [ '${{ steps.regression-test.outcome }}' == 'success' ] && \ + test_status=$([ '${{ steps.tests.outcome }}' == 'success' ] && \&& \ echo 'true' || echo 'false') build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \