From 683b7591326d0b1cd99939198a5b0319c42849bd Mon Sep 17 00:00:00 2001 From: Julien Lamy Date: Fri, 29 Sep 2023 10:13:56 +0200 Subject: [PATCH] Switch to micromamba --- .ci/build/conda.py | 4 +++- .github/workflows/build.yml | 22 +++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.ci/build/conda.py b/.ci/build/conda.py index b95748c..e489c89 100644 --- a/.ci/build/conda.py +++ b/.ci/build/conda.py @@ -1,7 +1,9 @@ import subprocess import sys +conda = sys.argv[1] if len(sys.argv) >= 2 else "conda" + subprocess.check_call([ - "conda", "install", "--yes", "-c", "conda-forge", + conda, "install", "--yes", "-c", "conda-forge", "boost", "cmake", "ninja", "numpy", "pybind11", "scipy", "xsimd", "xtensor", "xtensor-python"]) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ceeae6..b0aed87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,19 +18,10 @@ jobs: run: shell: bash -l {0} steps: - - name: Provision (Conda, Ubuntu) - # conda is initialized in .bashrc, but we are not using a login shell - run: echo 'export PATH="/usr/share/miniconda/bin:$PATH"' >> $HOME/.bash_profile - if: ${{ matrix.packaging == 'conda' && contains(matrix.os, 'ubuntu') }} - - - name: Provision (Conda, Windows) - run: C:\Miniconda\condabin\conda.bat init --all - shell: pwsh - if: ${{ matrix.packaging == 'conda' && contains(matrix.os, 'windows') }} - - - name: Provision (Conda, non-Windows) - run: conda init --all - if: ${{ matrix.packaging == 'conda' && !contains(matrix.os, 'windows') }} + - uses: mamba-org/setup-micromamba@v1 + with: + init-shell: bash powershell + if: ${{ matrix.packaging == 'conda' }} - name: Checkout latest revision # Only the latest revision is required, as later steps do not depend on @@ -43,8 +34,13 @@ jobs: git fetch origin --depth=1 ${{ github.ref }} git checkout ${{ github.ref_name }} + - name: Set-up (${{ matrix.packaging }}) + run: ${{ matrix.python }} .ci/build/${{ matrix.packaging }}.py micromamba + if: ${{ matrix.packaging == 'conda' }} + - name: Set-up (${{ matrix.packaging }}) run: ${{ matrix.python }} .ci/build/${{ matrix.packaging }}.py + if: ${{ matrix.packaging != 'conda' }} - name: Build sycomore run: ${{ matrix.python }} ./.ci/build/build.py