Skip to content

Commit

Permalink
Use sofa-setup-action for build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbrunet committed May 31, 2024
1 parent a90fe64 commit a79ce68
Showing 1 changed file with 15 additions and 37 deletions.
52 changes: 15 additions & 37 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ on:
jobs:
build:
name: Building with ${{ matrix.sofa_version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container: ${{ matrix.CONTAINER }}
strategy:
fail-fast: false
matrix:
sofa_version: [ master ]
include:
- sofa_version: master
SOFA_VERSION_I: 999999
CONTAINER: jnbrunet/caribou-ubuntu-2004-builder:latest
PYTHON_VERSION: 3.8
PYBIND11_VERSION: 2.6
sofa_branch: [ master ]
os: [ubuntu-22.04]
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: /opt/sofa
Expand All @@ -38,29 +33,14 @@ jobs:
git config --global user.name "Caribou Github"
git fetch origin
git rebase origin/master
- name: Install pybind11
if: ${{ matrix.PYBIND11_VERSION != '2.4' }}
run: |
git clone --depth 1 -b v${{ matrix.PYBIND11_VERSION }} https://github.com/pybind/pybind11.git /tmp/pybind11
cmake -GNinja -S/tmp/pybind11 -B/tmp/pybind11/build -DPYBIND11_TEST=OFF -DCMAKE_BUILD_TYPE=Release
cmake --install /tmp/pybind11/build
rm -rf /tmp/pybind11
- name: Download SOFA Release
run: |
if [ "$SOFA_VERSION" = "master" ]; then
curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/lastStableBuild/CI_BRANCH=master,CI_SCOPE=standard/artifact/Linux/*zip*/Linux.zip"
unzip sofa.zip -d temp
mv temp/Linux/`ls temp/Linux` sofa.zip
rm -rf temp
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
else
curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_Linux.zip"
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
fi
- name: Setup SOFA and environment
id: sofa
uses: sofa-framework/sofa-setup-action@v5
with:
sofa_root: ${{ github.workspace }}/sofa
sofa_version: ${{ matrix.sofa_branch }}
sofa_scope: 'standard'

- name: Get Time
id: time
Expand All @@ -83,14 +63,12 @@ jobs:
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: "500M"
PYTHONEXE: ${{ format('/usr/bin/python{0}', matrix.PYTHON_VERSION) }}
run:
export CCACHE_BASEDIR=$GITHUB_WORKSPACE &&
export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache &&
ccache -z &&
cmake
-GNinja
-DPYTHON_EXECUTABLE=$PYTHONEXE
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCARIBOU_BUILD_TESTS=ON
Expand All @@ -105,14 +83,14 @@ jobs:
- name: Archive production
uses: actions/upload-artifact@v2
with:
name: caribou_${{ matrix.sofa_version }}
name: caribou_${{ matrix.sofa_branch }}
path: SofaCaribou.tar.gz

test:
name: Testing with ${{ matrix.sofa_version }}
name: Testing with ${{ matrix.sofa_branch }}
needs: [build]
runs-on: ubuntu-20.04
container: ubuntu:20.04
runs-on: ubuntu-22.04
container: ubuntu:22.04
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit a79ce68

Please sign in to comment.