|
21 | 21 | sofa_root: ${{ github.workspace }}/sofa |
22 | 22 | sofa_version: ${{ matrix.sofa_branch }} |
23 | 23 | sofa_scope: 'full' |
| 24 | + |
24 | 25 | - name: Checkout source code |
25 | | - uses: actions/checkout@v2 |
| 26 | + uses: actions/checkout@v4 |
26 | 27 | with: |
27 | 28 | path: ${{ env.WORKSPACE_SRC_PATH }} |
28 | 29 |
|
@@ -80,49 +81,18 @@ jobs: |
80 | 81 | name: ${{ steps.sanitize.outputs.artifact_name }} |
81 | 82 | path: ${{ env.WORKSPACE_ARTIFACT_PATH }} |
82 | 83 |
|
83 | | - - name: Set env vars for tests |
84 | | - shell: bash |
85 | | - run: | |
86 | | - # Set env vars for tests |
87 | | - if [[ "$RUNNER_OS" == "Windows" ]]; then |
88 | | - echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH |
89 | | - echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH |
90 | | - echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH |
91 | | - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin" | tee -a $GITHUB_ENV |
92 | | - else |
93 | | - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV |
94 | | - fi |
95 | | -
|
96 | | - if [[ "$RUNNER_OS" == "macOS" ]]; then |
97 | | - echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV |
98 | | - fi |
99 | 84 |
|
100 | | - if [[ "$RUNNER_OS" == "Linux" ]]; then |
101 | | - echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV |
102 | | - fi |
103 | | -
|
104 | | - - name: Fetch, install and run Regression_test |
105 | | - id: regression-test |
106 | | - if: always() |
107 | | - shell: bash |
108 | | - run: | |
109 | | - if [[ "$RUNNER_OS" != "macOS" ]]; then |
110 | | - # Get regression from github releases |
111 | | - mkdir -p "${{ runner.temp }}/regression_tmp/install" |
112 | | - 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 |
113 | | - unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install" |
114 | | - # Install it in the SOFA bin directory |
115 | | - $SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin" |
116 | | - chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} |
117 | | - # Setup mandatory env vars |
118 | | - export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/examples" |
119 | | - export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references" |
120 | | - export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages |
121 | | - # Run regression test bench |
122 | | - ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} |
123 | | - else |
124 | | - echo "Regression tests are not supported on the CI for macOS yet (TODO)" |
125 | | - fi |
| 85 | + - name: Launch test |
| 86 | + id: tests |
| 87 | + uses: sofa-framework/sofa-test-action@v1.0 |
| 88 | + with: |
| 89 | + sofa_root: ${{ github.workspace }}/sofa |
| 90 | + sofa_version: ${{ steps.sofa.outputs.sofa_version }} |
| 91 | + src_dir: ${{ env.WORKSPACE_SRC_PATH }} |
| 92 | + build_dir: ${{ env.WORKSPACE_BUILD_PATH }} |
| 93 | + python_exe: ${{ steps.sofa.outputs.python_exe }} |
| 94 | + output_dir: ${{ github.workspace }}/tests-results_dir |
| 95 | + nb_parallel_threads: '4' |
126 | 96 |
|
127 | 97 | deploy: |
128 | 98 | name: Deploy artifacts |
|
0 commit comments