Skip to content

Commit

Permalink
[ci] Add regression tests (#4)
Browse files Browse the repository at this point in the history
* [ci] Update gitHup action workflow

* Add regression tests on ci

* fix ci ?

* fix ci on ubuntu ??

* remove python from yml

* Revert "remove python from yml"

This reverts commit 4c9889b.
  • Loading branch information
epernod authored Sep 4, 2024
1 parent 24c05ca commit a0c5915
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
echo ${CCACHE_BASEDIR}
ccache -s
fi
- name: Create artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -69,7 +70,48 @@ jobs:
with:
name: SofaSphFluid_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}

- name: Set env vars for tests
shell: bash
run: |
# Set env vars for tests
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH
echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH
echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin" | tee -a $GITHUB_ENV
else
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
fi
- name: Fetch, install and run Regression_test
if: always()
shell: bash
run: |
if [[ "$RUNNER_OS" != "macOS" ]]; then
# Get regression from github releases
mkdir -p "${{ runner.temp }}/regression_tmp/install"
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
unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install"
# Install it in the SOFA bin directory
$SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin"
chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
# Setup mandatory env vars
export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/examples"
export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references"
# Run regression test bench
${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }}
else
echo "Regression tests are not supported on the CI for macOS yet (TODO)"
fi
deploy:
name: Deploy artifacts
if: always() && startsWith(github.repository, 'sofa-framework') && (startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/')) # we are not on a fork and on a branch or a tag (not a PR) needs: [build-and-test]
Expand Down

0 comments on commit a0c5915

Please sign in to comment.