Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Backport ci update #23

Merged
merged 9 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 11 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,28 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
sofa_branch: [master]
python_version: ['3.8']
os: [ubuntu-22.04, macos-12, windows-2022]
sofa_branch: [v23.12]
python_version: ['3.10']

steps:
- name: (Mac) Workaround for homebrew
shell: bash
if: runner.os == 'macOS'
run: |
rm -f /usr/local/bin/2to3
rm -f /usr/local/bin/idle3
rm -f /usr/local/bin/pydoc3
rm -f /usr/local/bin/python3
rm -f /usr/local/bin/python3-config
rm -f /usr/local/bin/2to3-3.11
rm -f /usr/local/bin/idle3.11
rm -f /usr/local/bin/pydoc3.11
rm -f /usr/local/bin/python3.11
rm -f /usr/local/bin/python3.11-config

- name: Setup SOFA and environment
id: sofa
uses: sofa-framework/sofa-setup-action@v4
uses: sofa-framework/sofa-setup-action@v5
with:
sofa_root: ${{ github.workspace }}/sofa
sofa_version: ${{ matrix.sofa_branch }}
sofa_scope: 'standard'
sofa_with_sofapython3: 'false'
python_version: '${{ matrix.python_version }}'

- name: Install SofaPython3
shell: bash
run: |
SofaPython3_ROOT="$GITHUB_WORKSPACE/SofaPython3"
mkdir -p "${{ runner.temp }}/sp3_tmp/zip" "${{ runner.temp }}/sp3_tmp/binaries" "$SofaPython3_ROOT"
url="https://github.com/sofa-framework/SofaPython3/releases/download"
url="${url}/release-${{ matrix.sofa_branch }}/SofaPython3_${{ matrix.sofa_branch }}_python-${{ matrix.python_version }}_for-SOFA-${{ matrix.sofa_branch }}_${{ runner.os }}.zip"
echo "Getting SofaPython3 from $url"
curl --output "${{ runner.temp }}/sp3_tmp/SofaPython3.zip" -L $url
unzip -qq "${{ runner.temp }}/sp3_tmp/SofaPython3.zip" -d "${{ runner.temp }}/sp3_tmp/binaries"
mv "${{ runner.temp }}"/sp3_tmp/binaries/SofaPython3_*/* "$SofaPython3_ROOT"
echo "SofaPython3_ROOT=$SofaPython3_ROOT" | tee -a $GITHUB_ENV
echo "SofaPython3_DIR=$SofaPython3_ROOT/lib/cmake/SofaPython3" | tee -a $GITHUB_ENV

- name: Install SoftRobots
shell: bash
run: |
SoftRobots_ROOT="$GITHUB_WORKSPACE/SoftRobots"
mkdir -p "${{ runner.temp }}/sp3_tmp/zip" "${{ runner.temp }}/sp3_tmp/binaries" "$SoftRobots_ROOT"
url="https://github.com/SofaDefrost/SoftRobots/releases/download"
url="${url}/release-${{ matrix.sofa_branch }}/SoftRobots_${{ matrix.sofa_branch }}_python-${{ matrix.python_version }}_for-SOFA-${{ matrix.sofa_branch }}_${{ runner.os }}.zip"
url="${url}/release-${{ matrix.sofa_branch }}/SoftRobots_${{ matrix.sofa_branch }}_for-SOFA-${{ matrix.sofa_branch }}_${{ runner.os }}.zip"
echo "Getting SoftRobots from $url"
curl --output "${{ runner.temp }}/sp3_tmp/SoftRobots.zip" -L $url
unzip -qq "${{ runner.temp }}/sp3_tmp/SoftRobots.zip" -d "${{ runner.temp }}/sp3_tmp/binaries"
Expand Down Expand Up @@ -152,6 +123,8 @@ jobs:
ls -la "$WORKSPACE_SRC_PATH"
echo '------ ls -la "$WORKSPACE_BUILD_PATH" ------'
ls -la "$WORKSPACE_BUILD_PATH"
echo '------ ls -la "$WORKSPACE_BUILD_PATH/bin" ------'
ls -la "$WORKSPACE_BUILD_PATH/bin"
echo '------ ls -la "$WORKSPACE_INSTALL_PATH" ------'
ls -la "$WORKSPACE_INSTALL_PATH"
echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------'
Expand All @@ -165,13 +138,13 @@ jobs:
if: always()
shell: bash
run: |
chmod +x $WORKSPACE_BUILD_PATH/bin/SoftRobots.Inverse_test${{ steps.sofa.outputs.exe }}
cd $WORKSPACE_BUILD_PATH
./bin/SoftRobots_test${{ steps.sofa.outputs.exe }}
./bin/SoftRobots.Inverse_test${{ steps.sofa.outputs.exe }}

deploy:
name: Deploy artifacts
if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR)
needs: [build-and-test]
if: always() && startsWith(github.repository, 'SofaDefrost') && (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]
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand Down Expand Up @@ -217,7 +190,7 @@ jobs:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.RELEASE_TAGNAME }}
fail_on_unmatched_files: false
target_commitish: ${{ env.RELEASE_NAME }}
target_commitish: ${{ github.sha }}
body: |
Last updated on ${{ env.RELEASE_DATE }}
files: |
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(HEADER_FILES )
include(component/constraint/ConstraintTest.cmake)
include(component/solver/SolverTest.cmake)

find_package(Sofa.Testing)
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${RC_FILES})

target_include_directories(${PROJECT_NAME} PRIVATE "${SoftRobots_INCLUDE_DIRS}")
Expand Down
Loading