diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4983a414..3f0e0e48 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -10,92 +10,40 @@ on: jobs: build: - name: Building with ${{ matrix.sofa_version }} - runs-on: ubuntu-24.04 - container: ${{ matrix.CONTAINER }} + name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + runs-on: ${{ matrix.os }} 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 - env: - SOFA_VERSION: ${{ matrix.sofa_version }} - SOFA_ROOT: /opt/sofa - PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} + os: [ubuntu-22.04] + sofa_branch: [master] steps: - - uses: actions/checkout@v2 + - name: Setup SOFA and environment + id: sofa + uses: sofa-framework/sofa-setup-action@v5 with: - fetch-depth: 0 - - - run: | - git config --global user.email "caribou@github.com" - git config --global user.name "Caribou Github" - git fetch origin - git merge 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: Get Time - id: time - uses: nanzm/get-time-action@v1.0 - with: - timeZone: 8 - format: 'YYYY-MM-DD-HH-mm-ss' - - - name: ccache cache files - uses: actions/cache@v2 - if: ${{ always() }} + sofa_root: ${{ github.workspace }}/sofa + sofa_version: ${{ matrix.sofa_branch }} + sofa_scope: 'standard' + - name: Checkout source code + uses: actions/checkout@v2 with: - path: .ccache - key: ubuntu-ccache-${{ steps.time.outputs.time }} - restore-keys: | - ubuntu-ccache- + path: ${{ env.WORKSPACE_SRC_PATH }} - name: Build caribou - env: - CCACHE_COMPRESS: true - CCACHE_COMPRESSLEVEL: 6 - CCACHE_MAXSIZE: "500M" - PYTHONEXE: ${{ format('/usr/bin/python{0}', matrix.PYTHON_VERSION) }} - run: - export CCACHE_BASEDIR=$GITHUB_WORKSPACE && - cmake - -GNinja - -DPYTHON_EXECUTABLE=$PYTHONEXE - -DCARIBOU_BUILD_TESTS=ON - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=SofaCaribou - -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake + run: | + cd "$WORKSPACE_BUILD_PATH" + cmake \ + -GNinja \ + -DPYTHON_EXECUTABLE=$PYTHONEXE \ + -DCARIBOU_BUILD_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$WORKSPACE_INSTALL_PATH" \ + -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ . - && cmake --build . && cmake --install . - && tar czvf SofaCaribou.tar.gz SofaCaribou + cmake --build . && cmake --install . + tar czvf SofaCaribou.tar.gz SofaCaribou - name: Archive production uses: actions/upload-artifact@v4.4.0 @@ -122,11 +70,6 @@ jobs: CARIBOU_ROOT: /opt/sofa/plugins/SofaCaribou steps: - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.PYTHON_VERSION }} - - name: Install dependencies run: | apt-get update @@ -134,21 +77,6 @@ jobs: libgl1-mesa-glx libglib2.0-0 libglx0 libopengl0 libharfbuzz0b libgomp1 curl ca-certificates unzip python -m pip install numpy meshio scipy - - name: Install SOFA - 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: Download caribou uses: actions/download-artifact@v4.1.7 with: