Skip to content

Commit 67efa6c

Browse files
authored
[ci] Add regression tests (#24)
* [ci] Add regression tests references * [ci] Add regression to github workflow * [ci] up workflow * Remove scenes with SofaCarving
1 parent 34a7aeb commit 67efa6c

23 files changed

Lines changed: 80 additions & 24 deletions

.github/workflows/ci.yml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,13 @@ jobs:
1414
sofa_branch: [master]
1515

1616
steps:
17-
- name: (Mac) Workaround for homebrew
18-
shell: bash
19-
if: runner.os == 'macOS'
20-
run: |
21-
rm -f /usr/local/bin/2to3
22-
rm -f /usr/local/bin/idle3
23-
rm -f /usr/local/bin/pydoc3
24-
rm -f /usr/local/bin/python3
25-
rm -f /usr/local/bin/python3-config
26-
rm -f /usr/local/bin/2to3-3.11
27-
rm -f /usr/local/bin/idle3.11
28-
rm -f /usr/local/bin/pydoc3.11
29-
rm -f /usr/local/bin/python3.11
30-
rm -f /usr/local/bin/python3.11-config
31-
rm -f /usr/local/bin/go
32-
rm -f /usr/local/bin/gofmt
33-
3417
- name: Setup SOFA and environment
3518
id: sofa
3619
uses: sofa-framework/sofa-setup-action@v5
3720
with:
3821
sofa_root: ${{ github.workspace }}/sofa
3922
sofa_version: ${{ matrix.sofa_branch }}
40-
sofa_scope: 'full'
41-
23+
sofa_scope: 'standard'
4224
- name: Checkout source code
4325
uses: actions/checkout@v2
4426
with:
@@ -56,7 +38,7 @@ jobs:
5638
-DCMAKE_BUILD_TYPE=Release \
5739
-DCMAKE_INSTALL_PREFIX="$WORKSPACE_INSTALL_PATH" \
5840
../src \
59-
&& ninja -v install"
41+
&& ninja install"
6042
else
6143
cd "$WORKSPACE_BUILD_PATH"
6244
ccache -z
@@ -68,7 +50,7 @@ jobs:
6850
-DCMAKE_BUILD_TYPE=Release \
6951
-DCMAKE_INSTALL_PREFIX="$WORKSPACE_INSTALL_PATH" \
7052
../src
71-
ninja -v install
53+
ninja install
7254
echo ${CCACHE_BASEDIR}
7355
ccache -s
7456
fi
@@ -83,25 +65,47 @@ jobs:
8365
with:
8466
name: InfinyToolkit_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
8567
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
86-
68+
8769
- name: Set env vars for tests
8870
shell: bash
8971
run: |
9072
# Set env vars for tests
9173
if [[ "$RUNNER_OS" == "Windows" ]]; then
9274
echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH
9375
echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH
76+
echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH
9477
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin" | tee -a $GITHUB_ENV
9578
else
9679
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV
9780
fi
9881
9982
if [[ "$RUNNER_OS" == "macOS" ]]; then
100-
echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
83+
echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
10184
fi
10285
10386
if [[ "$RUNNER_OS" == "Linux" ]]; then
104-
echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
87+
echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
88+
fi
89+
90+
- name: Fetch, install and run Regression_test
91+
if: always()
92+
shell: bash
93+
run: |
94+
if [[ "$RUNNER_OS" != "macOS" ]]; then
95+
# Get regression from github releases
96+
mkdir -p "${{ runner.temp }}/regression_tmp/install"
97+
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
98+
unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install"
99+
# Install it in the SOFA bin directory
100+
$SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin"
101+
chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
102+
# Setup mandatory env vars
103+
export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/examples"
104+
export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references"
105+
# Run regression test bench
106+
${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
107+
else
108+
echo "Regression tests are not supported on the CI for macOS yet (TODO)"
105109
fi
106110
107111
deploy:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# WARNING:
2+
# REGRESSION_TEST DOES NOT SUPPORT DASHES ("-") IN SCENE NAMES.
3+
# USE UNDERSCORES ("_") INSTEAD.
4+
5+
../regression/references
6+
7+
### Demo scenes ###
8+
BeatingCube.scn 200 1e-4 1 1
9+
BeatingCube_moving.scn 200 1e-4 1 1
10+
Cube_AdvCarvingTexcoords.scn 500 1e-4 1 1
11+
# to be activated when SofaCarving is shipped
12+
#Cube_Carving.scn 500 1e-4 1 1
13+
#Cube_CarvingWithPenetration.scn 500 1e-4 1 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# WARNING:
2+
# REGRESSION_TEST DOES NOT SUPPORT DASHES ("-") IN SCENE NAMES.
3+
# USE UNDERSCORES ("_") INSTEAD.
4+
5+
### References relative path ###
6+
#../regression/references
7+
8+
### Topology scenes ###
9+
Triangle2RefinedTriangleTopologicalMapping.scn 100 1e-4 1

regression/references/BeatingCube.scn.reference

Whitespace-only changes.
Binary file not shown.

regression/references/BeatingCube_moving.scn.reference

Whitespace-only changes.
Binary file not shown.

regression/references/Cube_AdvCarvingTexcoords.scn.reference

Whitespace-only changes.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)