@@ -84,73 +84,18 @@ jobs:
8484 name : ${{ steps.sanitize.outputs.artifact_name }}
8585 path : ${{ env.WORKSPACE_ARTIFACT_PATH }}
8686
87- - name : Set env vars for tests
88- shell : bash
89- run : |
90- # Set env vars for tests
91- if [[ "$RUNNER_OS" == "Windows" ]]; then
92- echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH
93- echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH
94- echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH
95- echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin" | tee -a $GITHUB_ENV
96- else
97- echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV
98- fi
99-
100- if [[ "$RUNNER_OS" == "macOS" ]]; then
101- echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
102- fi
103-
104- if [[ "$RUNNER_OS" == "Linux" ]]; then
105- echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
106- fi
107-
108- # - name: Check environment for tests
109- # shell: bash
110- # run: |
111- # echo '------ ls -la "$WORKSPACE_SRC_PATH" ------'
112- # ls -la "$WORKSPACE_SRC_PATH"
113- # echo '------ ls -la "$WORKSPACE_BUILD_PATH" ------'
114- # ls -la "$WORKSPACE_BUILD_PATH"
115- # echo '------ ls -la "$WORKSPACE_INSTALL_PATH" ------'
116- # ls -la "$WORKSPACE_INSTALL_PATH"
117- # echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------'
118- # ls -la "$WORKSPACE_ARTIFACT_PATH"
119- # echo '----------------------'
120- # echo "SOFA_ROOT = $SOFA_ROOT"
12187
122-
123- - name : Run BeamAdapter_test
124- id : unit-test
125- if : always()
126- shell : bash
127- run : |
128- chmod +x $WORKSPACE_BUILD_PATH/bin/BeamAdapter_test${{ steps.sofa.outputs.exe }}
129- cd $WORKSPACE_BUILD_PATH
130- ./bin/BeamAdapter_test${{ steps.sofa.outputs.exe }}
131-
132- - name : Fetch, install and run Regression_test
133- id : regression-test
134- if : always()
135- shell : bash
136- run : |
137- if [[ "$RUNNER_OS" != "macOS" ]]; then
138- # Get regression from github releases
139- mkdir -p "${{ runner.temp }}/regression_tmp/install"
140- 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
141- unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install"
142- # Install it in the SOFA bin directory
143- $SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin"
144- chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
145- # Setup mandatory env vars
146- export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/examples"
147- export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references"
148- export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages
149- # Run regression test bench
150- ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
151- else
152- echo "Regression tests are not supported on the CI for macOS yet (TODO)"
153- fi
88+ - name : Launch test
89+ id : tests
90+ uses : sofa-framework/sofa-test-action@v1.0
91+ with :
92+ sofa_root : ${{ github.workspace }}/sofa
93+ sofa_version : ${{ steps.sofa.outputs.sofa_version }}
94+ src_dir : ${{ env.WORKSPACE_SRC_PATH }}
95+ build_dir : ${{ env.WORKSPACE_BUILD_PATH }}
96+ python_exe : ${{ steps.sofa.outputs.python_exe }}
97+ output_dir : ${{ github.workspace }}/tests-results_dir
98+ nb_parallel_threads : ' 4'
15499
155100 - name : Notify dashboard
156101 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:
159104 shell : bash
160105 run : |
161106
162- test_status=$([ '${{ steps.unit-test.outcome }}' == 'success' ] && \
163- [ '${{ steps.regression-test.outcome }}' == 'success' ] && \
107+ test_status=$([ '${{ steps.tests.outcome }}' == 'success' ] && \&& \
164108 echo 'true' || echo 'false')
165109
166110 build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \
0 commit comments