Skip to content

Commit

Permalink
Switch to setup-micromamba (#2610)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Jun 21, 2023
1 parent 0a7490c commit 8f93ee6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 36 deletions.
46 changes: 15 additions & 31 deletions .github/workflows/conda_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,35 @@ concurrency:

defaults:
run:
shell: bash -el {0}
shell: micromamba-shell {0}

jobs:
conda_nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: mamba
- name: create mamba build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-name: build_env
environment-file: mamba/mamba/environment-dev.yml
channels: conda-forge,conda-canary/label/dev
channel-priority: flexible
extra-specs: |
environment-file: ./mamba/environment-dev.yml
condarc: |
channels:
- conda-forge
- conda-canary/label/dev
channel-priority: flexible
create-args: >-
python=3.10
conda =*+*
conda=*+*
# Build Mamba
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
key: conda-canary-${{ github.job }}
restore-keys: conda-canary-
- name: build libmamba Python bindings
run: |
cd mamba
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
Expand All @@ -58,24 +57,17 @@ jobs:
ninja
ninja install
- name: install libmambapy
run: |
cd mamba
pip install -e ./libmambapy/ --no-deps
run: pip install -e ./libmambapy/ --no-deps
- name: build cache statistics
run: sccache --show-stats
- name: install mamba
run: |
cd mamba
pip install ./mamba[test] --no-deps
run: pip install ./mamba[test] --no-deps

# Test Mamba with Conda nightly
- name: run mamba tests suite
run: |
cd mamba
pytest -v --capture=tee-sys mamba/tests
run: pytest -v --capture=tee-sys mamba/tests
- name: run mamba create/update tests
run: |
cd mamba
mamba create -n test_env xtensor -c conda-forge -y
mamba env create -f mamba/tests/test_env.yml
mamba env update -f mamba/tests/update_env.yml
Expand All @@ -86,11 +78,3 @@ jobs:
filename: mamba/.github/workflows/bot_issue_template.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
rm -rf $(micromamba info --json | jq -r '."env location"')/envs || true
rm -rf ~/tmproot* || true
rm -rf $(micromamba info --json | jq -r '."env location"')/conda-build/conda-bld || true
8 changes: 3 additions & 5 deletions .github/workflows/static_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ jobs:
- name: Patch micromamba-feedstock
run: |
cp ./micromamba/recipe/* micromamba-feedstock/recipe/
- uses: mamba-org/provision-with-micromamba@main
- uses: mamba-org/setup-micromamba@v1
with:
channels: conda-forge
environment-file: false
environment-name: mambabuild
extra-specs: boa
create-args: boa
- name: Build conda package
shell: bash -l {0}
run: |
conda mambabuild -m micromamba-feedstock/.ci_support/${{ matrix.platform }}_${{ matrix.arch }}_.yaml \
conda-mambabuild -m micromamba-feedstock/.ci_support/${{ matrix.platform }}_${{ matrix.arch }}_.yaml \
micromamba-feedstock/recipe ${{ matrix.arch != '64' && '--no-test' || '' }}
- name: Unpack micromamba package
shell: bash -l {0}
Expand Down

0 comments on commit 8f93ee6

Please sign in to comment.