Skip to content

Commit 91686c4

Browse files
committed
[ci] Use new sofa-test-action
1 parent fb2a460 commit 91686c4

File tree

1 file changed

+12
-58
lines changed

1 file changed

+12
-58
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-22.04, windows-2022] #macos-14,
13+
os: [ubuntu-22.04, macos-14, windows-2022]
1414
sofa_branch: [master]
1515

1616
steps:
@@ -114,63 +114,17 @@ jobs:
114114
name: ${{ steps.sanitize.outputs.artifact_name }}
115115
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
116116

117-
- name: Set env vars for tests
118-
shell: bash
119-
run: |
120-
# Set env vars for tests
121-
if [[ "$RUNNER_OS" == "Windows" ]]; then
122-
echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH
123-
echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH
124-
echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH
125-
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin;$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/bin" | tee -a $GITHUB_ENV
126-
else
127-
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$GITHUB_WORKSPACE/downstream/ConstraintGeometry/install/lib" | tee -a $GITHUB_ENV
128-
fi
129-
130-
if [[ "$RUNNER_OS" == "macOS" ]]; then
131-
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
132-
fi
133-
134-
if [[ "$RUNNER_OS" == "Linux" ]]; then
135-
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
136-
fi
137-
138-
# - name: Check environment for tests
139-
# shell: bash
140-
# run: |
141-
# echo '------ ls -la "$WORKSPACE_SRC_PATH" ------'
142-
# ls -la "$WORKSPACE_SRC_PATH"
143-
# echo '------ ls -la "$WORKSPACE_BUILD_PATH" ------'
144-
# ls -la "$WORKSPACE_BUILD_PATH"
145-
# echo '------ ls -la "$WORKSPACE_INSTALL_PATH" ------'
146-
# ls -la "$WORKSPACE_INSTALL_PATH"
147-
# echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------'
148-
# ls -la "$WORKSPACE_ARTIFACT_PATH"
149-
# echo '----------------------'
150-
# echo "SOFA_ROOT = $SOFA_ROOT"
151-
152-
- name: Fetch, install and run Regression_test
153-
id: regression-test
154-
if: always()
155-
shell: bash
156-
run: |
157-
if [[ "$RUNNER_OS" != "macOS" ]]; then
158-
# Get regression from github releases
159-
mkdir -p "${{ runner.temp }}/regression_tmp/install"
160-
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
161-
unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install"
162-
# Install it in the SOFA bin directory
163-
$SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin"
164-
chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
165-
# Setup mandatory env vars
166-
export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/scenes"
167-
export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references"
168-
export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages
169-
# Run regression test bench
170-
${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
171-
else
172-
echo "Regression tests are not supported on the CI for macOS yet (TODO)"
173-
fi
117+
- name: Launch test
118+
id: tests
119+
uses: sofa-framework/sofa-test-action@v1.0
120+
with:
121+
sofa_root: ${{ github.workspace }}/sofa
122+
sofa_version: ${{ steps.sofa.outputs.sofa_version }}
123+
src_dir: ${{ env.WORKSPACE_SRC_PATH }}
124+
build_dir: ${{ env.WORKSPACE_BUILD_PATH }}
125+
python_exe: ${{ steps.sofa.outputs.python_exe }}
126+
output_dir: ${{ github.workspace }}/tests-results_dir
127+
nb_parallel_threads: '4'
174128

175129
deploy:
176130
name: Deploy artifacts

0 commit comments

Comments
 (0)