Skip to content

Commit 837a7ca

Browse files
epernodbakpaul
andauthored
[ci] Use new sofa-test-action (#42)
* Test github action from Paul * Try latest version * Add example install directory to CMake configuration * Fix remove old scene * try to debug * Apply suggestion from @epernod --------- Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>
1 parent b9ed8d8 commit 837a7ca

3 files changed

Lines changed: 17 additions & 123 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
sofa_root: ${{ github.workspace }}/sofa
2222
sofa_version: ${{ matrix.sofa_branch }}
2323
sofa_scope: 'full'
24+
2425
- name: Checkout source code
25-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2627
with:
2728
path: ${{ env.WORKSPACE_SRC_PATH }}
2829

@@ -80,49 +81,18 @@ jobs:
8081
name: ${{ steps.sanitize.outputs.artifact_name }}
8182
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
8283

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
9984

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'
12696

12797
deploy:
12898
name: Deploy artifacts

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
cmake_minimum_required(VERSION 3.12)
2222
project(InfinyToolkit VERSION 0.1)
2323

24+
include(cmake/environment.cmake)
25+
2426
find_package(Sofa.Component.StateContainer REQUIRED)
2527
find_package(Sofa.Component.MechanicalLoad REQUIRED)
2628
find_package(Sofa.Component.Topology.Container.Dynamic REQUIRED)
@@ -173,9 +175,10 @@ sofa_create_package_with_targets(
173175
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
174176
INCLUDE_SOURCE_DIR "src"
175177
INCLUDE_INSTALL_DIR ${PROJECT_NAME}
178+
EXAMPLE_INSTALL_DIR "examples"
176179
RELOCATABLE "plugins"
177180
)
178181

179182
# Organize projects into folders
180183
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
181-
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")
184+
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")

examples/Geomagic-SurfaceCarving.scn

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)