From 1e641b4d663ba87279a3be532ee4a4bcb8de6612 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Wed, 8 Jan 2025 17:49:43 +0100 Subject: [PATCH] testing reusable workflow (cont'd) --- .github/workflows/build-all.yml | 34 +++++++++++++ .github/workflows/build_publish_linux-64.yml | 2 +- .github/workflows/build_publish_osx-64.yml | 2 +- .github/workflows/build_publish_osx-arm64.yml | 2 +- .github/workflows/build_publish_package.yml | 33 +++++++++--- .github/workflows/build_publish_sofa.yml | 50 ------------------- .github/workflows/build_publish_win-64.yml | 2 +- .github/workflows/sofa-beamadapter.yml | 23 +++++++++ .github/workflows/sofa-cosserat.yml | 25 ++++++++++ .github/workflows/sofa-linux-64.yml | 13 ----- .../workflows/sofa-modelorderreduction.yml | 25 ++++++++++ .../workflows/sofa-python3-py38-linux-64.yml | 14 ------ .github/workflows/sofa-python3.yml | 25 ++++++++++ .github/workflows/sofa-softrobots.yml | 25 ++++++++++ .github/workflows/sofa-stlib.yml | 25 ++++++++++ .github/workflows/sofa.yml | 23 +++++++++ conda/configs/{linux64.yaml => linux-64.yaml} | 0 conda/configs/{osx64.yaml => osx-64.yaml} | 0 conda/configs/{win64.yaml => win-64.yaml} | 0 19 files changed, 234 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/build-all.yml delete mode 100644 .github/workflows/build_publish_sofa.yml create mode 100644 .github/workflows/sofa-beamadapter.yml create mode 100644 .github/workflows/sofa-cosserat.yml delete mode 100644 .github/workflows/sofa-linux-64.yml create mode 100644 .github/workflows/sofa-modelorderreduction.yml delete mode 100644 .github/workflows/sofa-python3-py38-linux-64.yml create mode 100644 .github/workflows/sofa-python3.yml create mode 100644 .github/workflows/sofa-softrobots.yml create mode 100644 .github/workflows/sofa-stlib.yml create mode 100644 .github/workflows/sofa.yml rename conda/configs/{linux64.yaml => linux-64.yaml} (100%) rename conda/configs/{osx64.yaml => osx-64.yaml} (100%) rename conda/configs/{win64.yaml => win-64.yaml} (100%) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml new file mode 100644 index 0000000..3d38185 --- /dev/null +++ b/.github/workflows/build-all.yml @@ -0,0 +1,34 @@ +name: sofa-all-packages +on: + - workflow_dispatch + +jobs: + build-publish-sofa: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + + steps: + - name: Build & publish sofa + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} + + - name: Build & publish sofa-beamadapter + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-beamadapter + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build_publish_linux-64.yml b/.github/workflows/build_publish_linux-64.yml index d63a8a4..d151089 100644 --- a/.github/workflows/build_publish_linux-64.yml +++ b/.github/workflows/build_publish_linux-64.yml @@ -1,4 +1,4 @@ -name: linux-64 +name: deprecated_linux-64 on: workflow_dispatch diff --git a/.github/workflows/build_publish_osx-64.yml b/.github/workflows/build_publish_osx-64.yml index 7ddd3cb..3eba03f 100644 --- a/.github/workflows/build_publish_osx-64.yml +++ b/.github/workflows/build_publish_osx-64.yml @@ -1,4 +1,4 @@ -name: osx-64 +name: deprecated_osx-64 on: workflow_dispatch diff --git a/.github/workflows/build_publish_osx-arm64.yml b/.github/workflows/build_publish_osx-arm64.yml index 1524f10..0bb8592 100644 --- a/.github/workflows/build_publish_osx-arm64.yml +++ b/.github/workflows/build_publish_osx-arm64.yml @@ -1,4 +1,4 @@ -name: osx-arm64 +name: deprecated_osx-arm64 on: workflow_dispatch diff --git a/.github/workflows/build_publish_package.yml b/.github/workflows/build_publish_package.yml index ff99ded..2a8df17 100644 --- a/.github/workflows/build_publish_package.yml +++ b/.github/workflows/build_publish_package.yml @@ -1,4 +1,4 @@ -name: sofa-package +name: common-build-publish-sofa-package on: workflow_call: @@ -6,7 +6,7 @@ on: package-name: required: true type: string - os: + runner: required: true type: string platform: @@ -24,15 +24,26 @@ on: jobs: build-publish-sofa: - name: "Build and publish ${{ inputs.package-name }} - ${{ inputs.platform }} conda packages for ${{ inputs.os }}" - runs-on: ${{ inputs.os }} - + name: "Build and publish ${{ inputs.package-name }} - ${{ inputs.platform }} (py${{ inputs.python }} ) conda packages on ${{ inputs.runner }}" + runs-on: ${{ inputs.runner }} steps: - uses: actions/checkout@v4 with: submodules: recursive - - uses: conda-incubator/setup-miniconda@v3 + # We force to use a conda env located close to filesystem root on Windows to bypass a compilation bug with SOFA + # due to too long filename, even if LongPath registry key is enabled + - name: Install miniconda [Windows] + if: contains(inputs.runner, 'windows') + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: c:\so + auto-update-conda: true + miniforge-version: latest + + - name: Install miniconda [Linux & macOS] + if: contains(inputs.runner, 'windows') == false + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: sofa-conda-ci auto-update-conda: true @@ -53,13 +64,19 @@ jobs: conda config --show printenv | sort + # Same remark here about too long filename bug on windows, we have to force the output directory accordingly on windows - name: Build & publish sofa conda package shell: bash -l {0} run: | + conda info cd conda/recipes - PKG_DIR=../../../rattler-bld + if [[ ${{ inputs.runner }} == "windows"* ]]; then + PKG_DIR=c:/so/bld + else + PKG_DIR=../../../rattler-bld + fi if [ ! -z "${{ inputs.python }}" ]; then - rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --variant-config ../configs/${{ inputs.python }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }} + rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --variant-config ../configs/python-${{ inputs.python }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }} else rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }} fi diff --git a/.github/workflows/build_publish_sofa.yml b/.github/workflows/build_publish_sofa.yml deleted file mode 100644 index 042685a..0000000 --- a/.github/workflows/build_publish_sofa.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: sofa - -on: - workflow_call: - inputs: - os: - required: true - type: string - platform: - required: true - type: string - -jobs: - build-publish-sofa: - name: "Build and publish SOFA conda packages for ${{ inputs.os }}" - runs-on: ${{ inputs.os }} - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: sofa-conda-ci - auto-update-conda: true - miniforge-version: latest - - - name: Install conda environment - shell: bash -l {0} - run: | - conda install anaconda-client rattler-build=0.31.1 -c conda-forge - conda config --set anaconda_upload no - - - name: Show conda config - shell: bash -l {0} - run: | - conda info - conda list - conda config --show-sources - conda config --show - printenv | sort - - - name: Build & publish sofa conda package - shell: bash -l {0} - run: | - cd conda/recipes - PKG_DIR=../../../rattler-bld - rattler-build build --recipe sofa/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --output-dir $PKG_DIR --experimental - anaconda -t ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} upload -u sofa-framework-prerelease -l main $PKG_DIR/**/*sofa*.conda --force diff --git a/.github/workflows/build_publish_win-64.yml b/.github/workflows/build_publish_win-64.yml index e9dad1a..57d75b4 100644 --- a/.github/workflows/build_publish_win-64.yml +++ b/.github/workflows/build_publish_win-64.yml @@ -1,4 +1,4 @@ -name: win-64 +name: deprecated_win-64 on: workflow_dispatch diff --git a/.github/workflows/sofa-beamadapter.yml b/.github/workflows/sofa-beamadapter.yml new file mode 100644 index 0000000..2f1df20 --- /dev/null +++ b/.github/workflows/sofa-beamadapter.yml @@ -0,0 +1,23 @@ +name: sofa-beamadapter +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-beamadapter: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-beamadapter + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-cosserat.yml b/.github/workflows/sofa-cosserat.yml new file mode 100644 index 0000000..f7de835 --- /dev/null +++ b/.github/workflows/sofa-cosserat.yml @@ -0,0 +1,25 @@ +name: sofa-cosserat +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-cosserat: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-cosserat + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + python: ${{ matrix.target.python }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-linux-64.yml b/.github/workflows/sofa-linux-64.yml deleted file mode 100644 index 1c087bd..0000000 --- a/.github/workflows/sofa-linux-64.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: sofa-linux-64 -on: workflow_dispatch - -jobs: - build-publish-sofa-linux-64: - uses: ./.github/workflows/build_publish_package.yml - with: - package-name: sofa - os: ubuntu-latest - platform: linux64 - anaconda-channel: sofa-framework-prerelease - secrets: - anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-modelorderreduction.yml b/.github/workflows/sofa-modelorderreduction.yml new file mode 100644 index 0000000..c57bf59 --- /dev/null +++ b/.github/workflows/sofa-modelorderreduction.yml @@ -0,0 +1,25 @@ +name: sofa-modelorderreduction +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-modelorderreduction: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-modelorderreduction + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + python: ${{ matrix.target.python }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-python3-py38-linux-64.yml b/.github/workflows/sofa-python3-py38-linux-64.yml deleted file mode 100644 index 61e9e0b..0000000 --- a/.github/workflows/sofa-python3-py38-linux-64.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: sofa-python3-py38-linux-64 -on: workflow_dispatch - -jobs: - build-publish-sofa-python3-py38-linux-64: - uses: ./.github/workflows/build_publish_package.yml - with: - package-name: sofa-python3 - os: ubuntu-latest - platform: linux64 - python: python-3.8 - anaconda-channel: sofa-framework-prerelease - secrets: - anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-python3.yml b/.github/workflows/sofa-python3.yml new file mode 100644 index 0000000..09468be --- /dev/null +++ b/.github/workflows/sofa-python3.yml @@ -0,0 +1,25 @@ +name: sofa-python3 +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-python3: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-python3 + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + python: ${{ matrix.target.python }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-softrobots.yml b/.github/workflows/sofa-softrobots.yml new file mode 100644 index 0000000..7b2682e --- /dev/null +++ b/.github/workflows/sofa-softrobots.yml @@ -0,0 +1,25 @@ +name: sofa-softrobots +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-softrobots: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-softrobots + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + python: ${{ matrix.target.python }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa-stlib.yml b/.github/workflows/sofa-stlib.yml new file mode 100644 index 0000000..aa75891 --- /dev/null +++ b/.github/workflows/sofa-stlib.yml @@ -0,0 +1,25 @@ +name: sofa-stlib +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa-stlib: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa-stlib + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + python: ${{ matrix.target.python }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sofa.yml b/.github/workflows/sofa.yml new file mode 100644 index 0000000..41fb6f7 --- /dev/null +++ b/.github/workflows/sofa.yml @@ -0,0 +1,23 @@ +name: sofa +on: + - workflow_call + - workflow_dispatch + +jobs: + build-publish-sofa: + strategy: + fail-fast: false + matrix: + target: [{platform: "linux-64", runner: "ubuntu-latest"}, + {platform: "osx-64", runner: "macos-13"}, + {platform: "osx-arm64", runner: "macos-14"}, + {platform: "win-64", runner: "windows-latest"}] + + uses: ./.github/workflows/build_publish_package.yml + with: + package-name: sofa + runner: ${{ matrix.target.runner }} + platform: ${{ matrix.target.platform }} + anaconda-channel: sofa-framework-prerelease + secrets: + anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }} \ No newline at end of file diff --git a/conda/configs/linux64.yaml b/conda/configs/linux-64.yaml similarity index 100% rename from conda/configs/linux64.yaml rename to conda/configs/linux-64.yaml diff --git a/conda/configs/osx64.yaml b/conda/configs/osx-64.yaml similarity index 100% rename from conda/configs/osx64.yaml rename to conda/configs/osx-64.yaml diff --git a/conda/configs/win64.yaml b/conda/configs/win-64.yaml similarity index 100% rename from conda/configs/win64.yaml rename to conda/configs/win-64.yaml