From 591f2d1ff796ca6c858330f57b60bbf728a0ebcb Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Wed, 28 Jul 2021 18:04:14 +0200 Subject: [PATCH 01/16] [GitHub] Improve workflow for Ubuntu and MacOS --- .github/workflows/macos.yml | 94 +++++++++++++++--------------- .github/workflows/ubuntu.yml | 107 ++++++++++++++++++----------------- 2 files changed, 102 insertions(+), 99 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6862def2..c4bc35ca 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,17 +1,18 @@ -name: CI +name: MacOS CI -on: pull_request +on: [workflow_dispatch, pull_request] jobs: build: - name: Building on ${{ matrix.os }} + name: Building on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-10.15] + sofa_branch: [master, v21.06] env: - TOKEN: ${{ secrets.SOFA_REPO_READ_TOKEN }} SOFA_ROOT: /opt/sofa + SYSTEM: MacOS steps: - name: Checkout source code @@ -25,20 +26,20 @@ jobs: - name: Install requirements run: | brew install ccache ninja boost eigen pybind11 - python3 -m pip install numpy + python3 -m pip install numpy scipy - - name: Download SOFA nightly build - run: | - curl --output sofa.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/lastSuccessfulBuild/CI_SCOPE=binaries_minimal/artifact/MacOS/*zip*/MacOS.zip - - - name: Install SOFA nightly build + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + shell: bash run: | - sudo unzip sofa.zip -d temp - sudo unzip temp/MacOS/`ls temp/MacOS/` -d temp - sudo rm -rf temp/MacOS - sudo mv temp/`ls temp` $SOFA_ROOT - rm -rf temp + mkdir -p /tmp/sofa_zip + mkdir -p /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip + unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} + sudo ls -la ${SOFA_ROOT} + rm -rf /tmp/sofa_* - name: Get Time id: time @@ -60,38 +61,39 @@ jobs: CCACHE_COMPRESS: true CCACHE_COMPRESSLEVEL: 6 CCACHE_MAXSIZE: "500M" - run: - export CCACHE_BASEDIR=$GITHUB_WORKSPACE && - export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache && - ccache -z && + run: | + export CCACHE_BASEDIR=$GITHUB_WORKSPACE + export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache + ccache -z cmake - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake - -DCMAKE_BUILD_TYPE=Release - -DPYTHON_EXECUTABLE=$(which python) - . - && ninja && ninja install - && echo ${CCACHE_BASEDIR} - && ccache -s - - - name: Archive production + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake + -DCMAKE_BUILD_TYPE=Release + -DPYTHON_EXECUTABLE=$(which python) + . + ninja install + echo ${CCACHE_BASEDIR} + ccache -s + + - name: Create artifact uses: actions/upload-artifact@v2 with: name: sp3-${{ matrix.os }} path: install tests: - name: Testing on ${{ matrix.os }} + name: Testing on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} needs: [build] runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-10.15] + sofa_branch: [master, v21.06] env: - TOKEN: ${{ secrets.SOFA_REPO_READ_TOKEN }} SOFA_ROOT: /opt/sofa + SYSTEM: MacOS steps: @@ -103,20 +105,20 @@ jobs: - name: Install requirements run: | brew install boost - python3 -m pip install numpy - - - name: Download SOFA nightly build - run: | - curl --output sofa.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/lastSuccessfulBuild/CI_SCOPE=binaries_minimal/artifact/MacOS/*zip*/MacOS.zip + python3 -m pip install numpy scipy - - name: Install SOFA nightly build + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + shell: bash run: | - sudo unzip sofa.zip -d temp - sudo unzip temp/MacOS/`ls temp/MacOS/` -d temp - sudo rm -rf temp/MacOS - sudo mv temp/`ls temp` $SOFA_ROOT - rm -rf temp + mkdir -p /tmp/sofa_zip + mkdir -p /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip + unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} + sudo ls -la ${SOFA_ROOT} + rm -rf /tmp/sofa_* - name: Install SP3 uses: actions/download-artifact@v2 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 41d5455e..5139cac1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,17 +1,18 @@ -name: CI +name: Ubuntu CI -on: pull_request +on: [workflow_dispatch, pull_request] jobs: build: - name: Building on ${{ matrix.os }} + name: Building on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-18.04] + sofa_branch: [master, v21.06] env: - TOKEN: ${{ secrets.SOFA_REPO_READ_TOKEN }} SOFA_ROOT: /opt/sofa + SYSTEM: Linux steps: - name: Checkout source code @@ -26,7 +27,7 @@ jobs: run: | sudo apt install -qq libeigen3-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev sudo apt install -qq ccache ninja-build - python3 -m pip install numpy + python3 -m pip install numpy scipy - name: Cache pybind11 uses: actions/cache@v2 @@ -35,26 +36,26 @@ jobs: path: /tmp/pybind11 key: pybind24 - - name: Build pybind11 + - name: Build and install pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' - run: git clone -b v2.4 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 && cd /tmp/pybind11 && cmake -DPYBIND11_TEST=OFF . && cmake -DPYBIND11_TEST=OFF . && make - - - name: Install pybind11 - run: cd /tmp/pybind11 && sudo make install - - - name: Download SOFA nightly build - run: | - curl --output sofa.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/lastSuccessfulBuild/CI_SCOPE=binaries_minimal/artifact/Linux/*zip*/Linux.zip + run: | + git clone -b v2.4 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 + cd /tmp/pybind11 + cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF . + make --silent install - - name: Install SOFA nightly build - run: | - sudo unzip sofa.zip -d temp - sudo unzip temp/Linux/`ls temp/Linux/` -d temp - sudo rm -rf temp/Linux - sudo mkdir -p $SOFA_ROOT - sudo mv temp/`ls temp`/* $SOFA_ROOT/ - sudo rm -rf temp + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + shell: bash + run: | + mkdir -p /tmp/sofa_zip + mkdir -p /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip + unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} + sudo ls -la ${SOFA_ROOT} + rm -rf /tmp/sofa_* - name: Get Time id: time @@ -76,40 +77,40 @@ jobs: CCACHE_COMPRESS: true CCACHE_COMPRESSLEVEL: 6 CCACHE_MAXSIZE: "500M" - run: - export CCACHE_BASEDIR=$GITHUB_WORKSPACE && - export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache && - ccache -z && + run: | + export CCACHE_BASEDIR=$GITHUB_WORKSPACE + export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache + ccache -z cmake - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake - -DCMAKE_BUILD_TYPE=Release - . - && ninja && ninja install - && echo ${CCACHE_BASEDIR} - && ccache -s - - - name: Archive production + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake + -DCMAKE_BUILD_TYPE=Release + . + ninja install + echo ${CCACHE_BASEDIR} + ccache -s + + - name: Create artifact uses: actions/upload-artifact@v2 with: name: sp3-${{ matrix.os }} path: install tests: - name: Testing on ${{ matrix.os }} + name: Testing on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} needs: [build] runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-18.04] + sofa_branch: [master, v21.06] env: - TOKEN: ${{ secrets.SOFA_REPO_READ_TOKEN }} SOFA_ROOT: /opt/sofa + SYSTEM: Linux steps: - - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -118,20 +119,20 @@ jobs: - name: Install requirements run: | sudo apt install -qq libboost-all-dev - python3 -m pip install numpy - - - name: Download SOFA nightly build - run: | - curl --output sofa.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/lastSuccessfulBuild/CI_SCOPE=binaries_minimal/artifact/Linux/*zip*/Linux.zip + python3 -m pip install numpy scipy - - name: Install SOFA nightly build + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + shell: bash run: | - sudo unzip sofa.zip -d temp - sudo unzip temp/Linux/`ls temp/Linux/` -d temp - sudo rm -rf temp/Linux - sudo mv temp/`ls temp` $SOFA_ROOT - sudo rm -rf temp + mkdir -p /tmp/sofa_zip + mkdir -p /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip + unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} + sudo ls -la ${SOFA_ROOT} + rm -rf /tmp/sofa_* - name: Install SP3 uses: actions/download-artifact@v2 From 13c805881ff177ead2714d8527ee06c7677119f1 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Wed, 28 Jul 2021 18:08:09 +0200 Subject: [PATCH 02/16] [GitHub] Simpler names for workflows --- .github/workflows/macos.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c4bc35ca..0501e78d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,7 +4,7 @@ on: [workflow_dispatch, pull_request] jobs: build: - name: Building on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + name: Building with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -84,7 +84,7 @@ jobs: path: install tests: - name: Testing on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + name: Testing with SOFA ${{ matrix.sofa_branch }} needs: [build] runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5139cac1..4500b70d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,7 +4,7 @@ on: [workflow_dispatch, pull_request] jobs: build: - name: Building on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + name: Building with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -99,7 +99,7 @@ jobs: path: install tests: - name: Testing on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} + name: Testing with SOFA ${{ matrix.sofa_branch }} needs: [build] runs-on: ${{ matrix.os }} strategy: From bae09bd0f301a74df825cc1e2929243143884c4e Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Wed, 28 Jul 2021 18:11:32 +0200 Subject: [PATCH 03/16] [GitHub] FIX pybind11 install in Ubuntu workflow --- .github/workflows/ubuntu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4500b70d..dd76851c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -42,7 +42,8 @@ jobs: git clone -b v2.4 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 cd /tmp/pybind11 cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF . - make --silent install + sudo make --silent install + rm -rf /tmp/pybind11 - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries shell: bash From 911fc3fe45e8078df4d47299e75cfc693ba330b3 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Wed, 28 Jul 2021 18:13:23 +0200 Subject: [PATCH 04/16] [GitHub] FIX multiline command in workflows --- .github/workflows/macos.yml | 14 +++++++------- .github/workflows/ubuntu.yml | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0501e78d..606deaad 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -65,13 +65,13 @@ jobs: export CCACHE_BASEDIR=$GITHUB_WORKSPACE export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -z - cmake - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake - -DCMAKE_BUILD_TYPE=Release - -DPYTHON_EXECUTABLE=$(which python) + cmake \ + -GNinja \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DPYTHON_EXECUTABLE=$(which python) \ . ninja install echo ${CCACHE_BASEDIR} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index dd76851c..e2ac1dc4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -82,12 +82,12 @@ jobs: export CCACHE_BASEDIR=$GITHUB_WORKSPACE export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -z - cmake - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake - -DCMAKE_BUILD_TYPE=Release + cmake \ + -GNinja \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ + -DCMAKE_BUILD_TYPE=Release \ . ninja install echo ${CCACHE_BASEDIR} From b5d3eaf4a91b9b8bdcc5c7d169b40ce2a6e04b6f Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 16:04:19 +0200 Subject: [PATCH 05/16] [GitHub] FIX workflow artifact names --- .github/workflows/macos.yml | 6 ++---- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 606deaad..fbc00699 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -71,7 +71,6 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DPYTHON_EXECUTABLE=$(which python) \ . ninja install echo ${CCACHE_BASEDIR} @@ -80,7 +79,7 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: sp3-${{ matrix.os }} + name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} path: install tests: @@ -96,7 +95,6 @@ jobs: SYSTEM: MacOS steps: - - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -123,7 +121,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: sp3-${{ matrix.os }} + name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} path: SofaPython3 - name: Binding.Sofa.Tests diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e2ac1dc4..674bc7c6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -96,7 +96,7 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: sp3-${{ matrix.os }} + name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} path: install tests: @@ -138,7 +138,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: sp3-${{ matrix.os }} + name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} path: SofaPython3 - name: Binding.Sofa.Tests From ebd1376652f57112bd598e218f7588233502317a Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 16:14:47 +0200 Subject: [PATCH 06/16] [GitHub] Change cache strategy --- .github/workflows/macos.yml | 11 +---------- .github/workflows/ubuntu.yml | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fbc00699..afb34767 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -41,20 +41,11 @@ jobs: sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* - - 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 with: path: .ccache - key: ${{ matrix.os }}-ccache-${{ steps.time.outputs.time }} - restore-keys: | - ${{ matrix.os }}-ccache- + key: ccache_${{ matrix.sofa_branch }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} - name: Build env: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 674bc7c6..a0e03358 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -58,20 +58,11 @@ jobs: sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* - - 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 with: path: .ccache - key: ${{ matrix.os }}-ccache-${{ steps.time.outputs.time }} - restore-keys: | - ${{ matrix.os }}-ccache- + key: ccache_${{ matrix.sofa_branch }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} - name: Build env: From ef6c3b6f4b7c3a58ef13a6c88fb57188b25b9986 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 18:20:51 +0200 Subject: [PATCH 07/16] [GitHub] Clean and simplify --- .github/workflows/macos.yml | 52 ++++++++++++++++++++++--------- .github/workflows/ubuntu.yml | 59 ++++++++++++++++++++++++------------ 2 files changed, 77 insertions(+), 34 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index afb34767..275172e6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,12 +12,23 @@ jobs: sofa_branch: [master, v21.06] env: SOFA_ROOT: /opt/sofa - SYSTEM: MacOS + SOFA_OS: MacOS steps: - name: Checkout source code uses: actions/checkout@v2 + - name: Set env vars + run: | + if [ -n "$GITHUB_BASE_REF" ]; then + GIT_BRANCH="$GITHUB_BASE_REF" + else + GIT_BRANCH="${GITHUB_REF#refs/heads/}" + fi + echo "GIT_BRANCH = $GIT_BRANCH" + if [ -z "$GIT_BRANCH" ]; then exit 1; fi + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -28,15 +39,15 @@ jobs: brew install ccache ninja boost eigen pybind11 python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip mkdir -p /tmp/sofa_binaries - curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip - unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip - unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SOFA_OS}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SOFA_OS}/*zip*/${SOFA_OS}.zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}/SOFA_*.zip -d /tmp/sofa_binaries sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* @@ -45,7 +56,7 @@ jobs: uses: actions/cache@v2 with: path: .ccache - key: ccache_${{ matrix.sofa_branch }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} - name: Build env: @@ -70,7 +81,7 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} + name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} path: install tests: @@ -83,9 +94,20 @@ jobs: sofa_branch: [master, v21.06] env: SOFA_ROOT: /opt/sofa - SYSTEM: MacOS + SOFA_OS: MacOS steps: + - name: Set env vars + run: | + if [ -n "$GITHUB_BASE_REF" ]; then + GIT_BRANCH="$GITHUB_BASE_REF" + else + GIT_BRANCH="${GITHUB_REF#refs/heads/}" + fi + echo "GIT_BRANCH = $GIT_BRANCH" + if [ -z "$GIT_BRANCH" ]; then exit 1; fi + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -96,15 +118,15 @@ jobs: brew install boost python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip mkdir -p /tmp/sofa_binaries - curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip - unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip - unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SOFA_OS}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SOFA_OS}/*zip*/${SOFA_OS}.zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}/SOFA_*.zip -d /tmp/sofa_binaries sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* @@ -112,7 +134,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} + name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} path: SofaPython3 - name: Binding.Sofa.Tests diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a0e03358..ee670d61 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -12,12 +12,23 @@ jobs: sofa_branch: [master, v21.06] env: SOFA_ROOT: /opt/sofa - SYSTEM: Linux + SOFA_OS: Linux steps: - name: Checkout source code uses: actions/checkout@v2 + - name: Set env vars + run: | + if [ -n "$GITHUB_BASE_REF" ]; then + GIT_BRANCH="$GITHUB_BASE_REF" + else + GIT_BRANCH="${GITHUB_REF#refs/heads/}" + fi + echo "GIT_BRANCH = $GIT_BRANCH" + if [ -z "$GIT_BRANCH" ]; then exit 1; fi + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -29,12 +40,12 @@ jobs: sudo apt install -qq ccache ninja-build python3 -m pip install numpy scipy - - name: Cache pybind11 + - name: pybind11 cache files uses: actions/cache@v2 id: pybind11_cache with: path: /tmp/pybind11 - key: pybind24 + key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} - name: Build and install pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' @@ -43,17 +54,16 @@ jobs: cd /tmp/pybind11 cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF . sudo make --silent install - rm -rf /tmp/pybind11 - - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip mkdir -p /tmp/sofa_binaries - curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip - unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip - unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SOFA_OS}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SOFA_OS}/*zip*/${SOFA_OS}.zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}/SOFA_*.zip -d /tmp/sofa_binaries sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* @@ -62,7 +72,7 @@ jobs: uses: actions/cache@v2 with: path: .ccache - key: ccache_${{ matrix.sofa_branch }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} - name: Build env: @@ -87,11 +97,11 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} + name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} path: install tests: - name: Testing with SOFA ${{ matrix.sofa_branch }} + name: Testing on ${{ matrix.os }} needs: [build] runs-on: ${{ matrix.os }} strategy: @@ -100,9 +110,20 @@ jobs: sofa_branch: [master, v21.06] env: SOFA_ROOT: /opt/sofa - SYSTEM: Linux + SOFA_OS: Linux steps: + - name: Set env vars + run: | + if [ -n "$GITHUB_BASE_REF" ]; then + GIT_BRANCH="$GITHUB_BASE_REF" + else + GIT_BRANCH="${GITHUB_REF#refs/heads/}" + fi + echo "GIT_BRANCH = $GIT_BRANCH" + if [ -z "$GIT_BRANCH" ]; then exit 1; fi + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -113,15 +134,15 @@ jobs: sudo apt install -qq libboost-all-dev python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries + - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip mkdir -p /tmp/sofa_binaries - curl --output /tmp/sofa_zip/${SYSTEM}.zip -L \ - https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SYSTEM}/*zip*/${SYSTEM}.zip - unzip -qq /tmp/sofa_zip/${SYSTEM}.zip -d /tmp/sofa_zip - unzip -qq /tmp/sofa_zip/${SYSTEM}/SOFA_*.zip -d /tmp/sofa_binaries + curl --output /tmp/sofa_zip/${SOFA_OS}.zip -L \ + https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=${{ matrix.sofa_branch }},CI_SCOPE=minimal/lastSuccessfulBuild/artifact/${SOFA_OS}/*zip*/${SOFA_OS}.zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}.zip -d /tmp/sofa_zip + unzip -qq /tmp/sofa_zip/${SOFA_OS}/SOFA_*.zip -d /tmp/sofa_binaries sudo mv /tmp/sofa_binaries/SOFA_* ${SOFA_ROOT} sudo ls -la ${SOFA_ROOT} rm -rf /tmp/sofa_* @@ -129,7 +150,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: SofaPython3_${{ matrix.sofa_branch }}_${{ matrix.os }} + name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} path: SofaPython3 - name: Binding.Sofa.Tests From 5b2053354d423478d787aa516c319884834031d0 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 18:35:21 +0200 Subject: [PATCH 08/16] [GitHub] Better branch name for PRs --- .github/workflows/macos.yml | 9 +++++---- .github/workflows/ubuntu.yml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 275172e6..e9bf0b2c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,8 +20,8 @@ jobs: - name: Set env vars run: | - if [ -n "$GITHUB_BASE_REF" ]; then - GIT_BRANCH="$GITHUB_BASE_REF" + if [ -n "${{ github.event.issue.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" fi @@ -73,6 +73,7 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DPYTHON_EXECUTABLE=$(which python3.7) \ . ninja install echo ${CCACHE_BASEDIR} @@ -99,8 +100,8 @@ jobs: steps: - name: Set env vars run: | - if [ -n "$GITHUB_BASE_REF" ]; then - GIT_BRANCH="$GITHUB_BASE_REF" + if [ -n "${{ github.event.issue.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" fi diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ee670d61..971293e0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,8 +20,8 @@ jobs: - name: Set env vars run: | - if [ -n "$GITHUB_BASE_REF" ]; then - GIT_BRANCH="$GITHUB_BASE_REF" + if [ -n "${{ github.event.issue.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" fi @@ -89,6 +89,7 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DPYTHON_EXECUTABLE=$(which python3.7) \ . ninja install echo ${CCACHE_BASEDIR} @@ -115,8 +116,8 @@ jobs: steps: - name: Set env vars run: | - if [ -n "$GITHUB_BASE_REF" ]; then - GIT_BRANCH="$GITHUB_BASE_REF" + if [ -n "${{ github.event.issue.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" fi From 34094df18c1ecca9dac108d84d8f99e5bca14c70 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 18:39:57 +0200 Subject: [PATCH 09/16] [GitHub] Better branch name for PRs (2) --- .github/workflows/macos.yml | 18 ++++++++++++++++-- .github/workflows/ubuntu.yml | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e9bf0b2c..3fe24797 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,7 +20,14 @@ jobs: - name: Set env vars run: | - if [ -n "${{ github.event.issue.number }}" ]; then + echo github.event.number = ${{ github.event.number }} + echo github.event.pull_request.number = ${{ github.event.pull_request.number }} + echo github.event.issue.number = ${{ github.event.issue.number }} + if [ -n "${{ github.event.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.number }}" + elif [ -n "${{ github.event.pull_request.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.pull_request.number }}" + elif [ -n "${{ github.event.issue.number }}" ]; then GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" @@ -100,7 +107,14 @@ jobs: steps: - name: Set env vars run: | - if [ -n "${{ github.event.issue.number }}" ]; then + echo github.event.number = ${{ github.event.number }} + echo github.event.pull_request.number = ${{ github.event.pull_request.number }} + echo github.event.issue.number = ${{ github.event.issue.number }} + if [ -n "${{ github.event.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.number }}" + elif [ -n "${{ github.event.pull_request.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.pull_request.number }}" + elif [ -n "${{ github.event.issue.number }}" ]; then GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 971293e0..46336807 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,7 +20,14 @@ jobs: - name: Set env vars run: | - if [ -n "${{ github.event.issue.number }}" ]; then + echo github.event.number = ${{ github.event.number }} + echo github.event.pull_request.number = ${{ github.event.pull_request.number }} + echo github.event.issue.number = ${{ github.event.issue.number }} + if [ -n "${{ github.event.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.number }}" + elif [ -n "${{ github.event.pull_request.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.pull_request.number }}" + elif [ -n "${{ github.event.issue.number }}" ]; then GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" @@ -116,7 +123,14 @@ jobs: steps: - name: Set env vars run: | - if [ -n "${{ github.event.issue.number }}" ]; then + echo github.event.number = ${{ github.event.number }} + echo github.event.pull_request.number = ${{ github.event.pull_request.number }} + echo github.event.issue.number = ${{ github.event.issue.number }} + if [ -n "${{ github.event.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.number }}" + elif [ -n "${{ github.event.pull_request.number }}" ]; then + GIT_BRANCH="PR-${{ github.event.pull_request.number }}" + elif [ -n "${{ github.event.issue.number }}" ]; then GIT_BRANCH="PR-${{ github.event.issue.number }}" else GIT_BRANCH="${GITHUB_REF#refs/heads/}" From 5b22b33d6641230631fe2f1a3c41234f2b9a0ce0 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 18:49:07 +0200 Subject: [PATCH 10/16] [GitHub] CLEAN unify pybind11 install --- .github/workflows/macos.yml | 22 +++++++++++++++++++--- .github/workflows/ubuntu.yml | 8 ++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3fe24797..7ac8ec9c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -43,10 +43,26 @@ jobs: - name: Install requirements run: | - brew install ccache ninja boost eigen pybind11 + brew install eigen boost + brew install ccache ninja python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries + - name: pybind11 cache files + uses: actions/cache@v2 + id: pybind11_cache + with: + path: /tmp/pybind11 + key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + + - name: Build and install pybind11 + if: steps.pybind11_cache.outputs.cache-hit != 'true' + run: | + git clone -b v2.4.3 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 + cd /tmp/pybind11 + cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF -DPYTHON_EXECUTABLE=$(which python3.7) . + sudo make --silent install + + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip @@ -133,7 +149,7 @@ jobs: brew install boost python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 46336807..f8b83e65 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -57,12 +57,12 @@ jobs: - name: Build and install pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' run: | - git clone -b v2.4 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 + git clone -b v2.4.3 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 cd /tmp/pybind11 - cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF . + cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF -DPYTHON_EXECUTABLE=$(which python3.7) . sudo make --silent install - - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip @@ -149,7 +149,7 @@ jobs: sudo apt install -qq libboost-all-dev python3 -m pip install numpy scipy - - name: Download and install the latest SOFA ${{ env.SOFA_BRANCH }} binaries + - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries shell: bash run: | mkdir -p /tmp/sofa_zip From 24681cd7218ab01d4e22d2894a333ad2957e298e Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 18:58:26 +0200 Subject: [PATCH 11/16] [GitHub] Set "fail-fast: false" on all strategies --- .github/workflows/macos.yml | 2 ++ .github/workflows/ubuntu.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7ac8ec9c..cc95307c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,6 +7,7 @@ jobs: name: Building with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-10.15] sofa_branch: [master, v21.06] @@ -113,6 +114,7 @@ jobs: needs: [build] runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-10.15] sofa_branch: [master, v21.06] diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f8b83e65..a348d080 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,6 +7,7 @@ jobs: name: Building with SOFA ${{ matrix.sofa_branch }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-18.04] sofa_branch: [master, v21.06] @@ -113,6 +114,7 @@ jobs: needs: [build] runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-18.04] sofa_branch: [master, v21.06] From 63d7a0e11ee9cb3fe6dfabea36b67d74f8f32c55 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Thu, 29 Jul 2021 19:13:21 +0200 Subject: [PATCH 12/16] [GitHub] Clean hash in cache keys --- .github/workflows/macos.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cc95307c..878a0762 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -53,7 +53,7 @@ jobs: id: pybind11_cache with: path: /tmp/pybind11 - key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - name: Build and install pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' @@ -80,7 +80,7 @@ jobs: uses: actions/cache@v2 with: path: .ccache - key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - name: Build env: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a348d080..6412d671 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -53,7 +53,7 @@ jobs: id: pybind11_cache with: path: /tmp/pybind11 - key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - name: Build and install pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' @@ -80,7 +80,7 @@ jobs: uses: actions/cache@v2 with: path: .ccache - key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('**/lockfiles') }} + key: ccache_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - name: Build env: From 5c3dafb45770c2d36d116a98767d179e533a880c Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Fri, 30 Jul 2021 12:20:58 +0200 Subject: [PATCH 13/16] [GitHub] FIX pybind11 cache --- .github/workflows/macos.yml | 7 ++++++- .github/workflows/ubuntu.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 878a0762..64fc2665 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -55,12 +55,17 @@ jobs: path: /tmp/pybind11 key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - - name: Build and install pybind11 + - name: Build pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' run: | git clone -b v2.4.3 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 cd /tmp/pybind11 cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF -DPYTHON_EXECUTABLE=$(which python3.7) . + make --silent + + - name: Install pybind11 + run: | + cd /tmp/pybind11 sudo make --silent install - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6412d671..66e5b4ab 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -55,12 +55,17 @@ jobs: path: /tmp/pybind11 key: pybind11_${{ env.GIT_BRANCH }}_${{ matrix.os }}_${{ hashFiles('.github/workflows/*.yml') }} - - name: Build and install pybind11 + - name: Build pybind11 if: steps.pybind11_cache.outputs.cache-hit != 'true' run: | git clone -b v2.4.3 --depth 1 https://github.com/pybind/pybind11.git /tmp/pybind11 cd /tmp/pybind11 cmake -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF -DPYTHON_EXECUTABLE=$(which python3.7) . + make --silent + + - name: Install pybind11 + run: | + cd /tmp/pybind11 sudo make --silent install - name: Download and install the latest SOFA ${{ matrix.sofa_branch }} binaries From 3f096a7d188e12003a94e4df96f07d69b691e38f Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Fri, 30 Jul 2021 12:56:08 +0200 Subject: [PATCH 14/16] Quick fix Threads::Threads issue --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6067a250..07c31312 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ if (SP3_COMPILED_AS_SOFA_SUBPROJECT) else() option(SP3_BUILD_TEST "Compile the automatic tests for SofaPython3, along with the gtest library." ON) endif() +if(SP3_BUILD_TEST) + # TODO: remove this when SOFA's GTest handles threads correctly + find_package(Threads REQUIRED) +endif() find_package(SofaExporter QUIET) CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAEXPORTER "Bind the SOFA exporter component." ON "SofaExporter_FOUND" OFF) From a5d7485ab5995233310dcec7e97c50a5f83d39a5 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Fri, 30 Jul 2021 13:05:57 +0200 Subject: [PATCH 15/16] Fix tests job name on Ubuntu --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 66e5b4ab..b0b9ea30 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -115,7 +115,7 @@ jobs: path: install tests: - name: Testing on ${{ matrix.os }} + name: Testing with SOFA ${{ matrix.sofa_branch }} needs: [build] runs-on: ${{ matrix.os }} strategy: From 92a9aae29c7d41f041432ba85696ae68280806c8 Mon Sep 17 00:00:00 2001 From: Guillaume Paran Date: Fri, 30 Jul 2021 16:40:05 +0200 Subject: [PATCH 16/16] Fix artifact names --- .github/workflows/macos.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 64fc2665..214754c5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -111,7 +111,7 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} + name: SofaPython3_${{ env.GIT_BRANCH }}_SOFA-${{ matrix.sofa_branch }}_${{ env.SOFA_OS }} path: install tests: @@ -172,7 +172,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} + name: SofaPython3_${{ env.GIT_BRANCH }}_SOFA-${{ matrix.sofa_branch }}_${{ env.SOFA_OS }} path: SofaPython3 - name: Binding.Sofa.Tests diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index b0b9ea30..e629a37f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -111,7 +111,7 @@ jobs: - name: Create artifact uses: actions/upload-artifact@v2 with: - name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} + name: SofaPython3_${{ env.GIT_BRANCH }}_SOFA-${{ matrix.sofa_branch }}_${{ env.SOFA_OS }} path: install tests: @@ -172,7 +172,7 @@ jobs: - name: Install SP3 uses: actions/download-artifact@v2 with: - name: SofaPython3_${{ env.GIT_BRANCH }}_${SOFA_OS} + name: SofaPython3_${{ env.GIT_BRANCH }}_SOFA-${{ matrix.sofa_branch }}_${{ env.SOFA_OS }} path: SofaPython3 - name: Binding.Sofa.Tests