Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to setup-micromamba #2495

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions .github/workflows/conda_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 0'
# push: # TODO remove

permissions:
contents: read
Expand All @@ -15,36 +16,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/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,39 +58,35 @@ jobs:
ninja
ninja install
- name: install libmambapy
run: |
cd mamba
pip install -e ./libmambapy/ --no-deps
run: pip install -e ./libmambapy/ --no-deps
working-directory: mamba
- 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

- uses: JasonEtco/create-an-issue@1a16035489d05041b9af40b970f02e301c52ffba
if: failure()
with:
filename: mamba/.github/workflows/bot_issue_template.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO: uncomment
# - uses: JasonEtco/create-an-issue@1a16035489d05041b9af40b970f02e301c52ffba
# if: failure()
# with:
# filename: .github/workflows/bot_issue_template.md
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup
if: always()
shell: bash # no need for micromamba-shell
# Do not cache temporary envs with 'cache-environment: true'
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
27 changes: 11 additions & 16 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Linters (Python, C++)

on:
push:
branches:
- main
pull_request:
branches:
- main
- maadwdwdwd
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,18 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install pre-commit
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: linters
channels: conda-forge
extra-specs: pre-commit
- name: Micromamba info
shell: bash -el {0}
run: |
micromamba info
micromamba list
create-args: pre-commit
- name: Run all linters
shell: bash -el {0}
run: |
pre-commit run --all-files --verbose --show-diff-on-failure
shell: micromamba-shell {0}
run: pre-commit run --all-files --verbose --show-diff-on-failure
Loading