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

Use micromamba for CI builds #812

Merged
merged 6 commits into from
Jul 13, 2023
Merged
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
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Checklist:
* [ ] Add docstrings and API docs for any new/modified user-facing classes and functions
* [ ] New/modified features documented in `docs/source/*`
* [ ] Changes documented in `CHANGES.md`
* [ ] GitHub CI passes
* [ ] AppVeyor CI passes
* [ ] Test coverage remains or increases (target 100%)
11 changes: 6 additions & 5 deletions .github/workflows/xcube_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ jobs:
steps:
- uses: actions/checkout@v2
# Setup miniconda build env
- uses: conda-incubator/setup-[email protected]
- uses: mamba-org/setup-micromamba@v1
with:
miniconda-version: py39_22.11.1-1
mamba-version: "*"
channels: conda-forge
activate-environment: xcube
micromamba-version: '1.4.8-0'
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
# Setup xcube
- name: setup-xcube
shell: bash -l {0}
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changes in 1.1.3 (in development)

* Updated AppVeyor and GitHub workflow configurations to use micromamba rather
than mamba (#785)

## Changes in 1.1.2

### Fixes
Expand Down
61 changes: 36 additions & 25 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,53 @@ for:
only:
- image: macos
install:
- curl -L https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- curl -Ls https://micromamba.snakepit.net/api/micromamba/osx-64/latest | tar -xvj bin/micromamba
- mv bin/micromamba ./micromamba
-
matrix:
only:
- image: Ubuntu2004
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba --strip-components=1

build_script:
- export PATH="$HOME/miniconda/bin:$PATH"
# Diagnostics
- echo $PLATFORM
- echo $APPVEYOR_BUILD_WORKER_IMAGE
- uname -a
- pwd
- ls

# Set up micromamba
- ./micromamba shell init -s bash -p ~/micromamba
- source ~/.bashrc
- source ~/.bash_profile
- hash -r
- conda config --set always_yes yes --set changeps1 no
# - conda update -q conda # makes travis build fail
# Useful for debugging any issues with conda
- conda info -a
- conda init bash
- export CONDA_BASE=$(conda info --base)
- source $CONDA_BASE/etc/profile.d/conda.sh

# Install mamba as a dramatically faster conda replacement. Specifying a
# fixed version makes the installation of mamba itself much faster, and
# avoids potential breakage due to changes in mamba behaviour.
- conda install -c conda-forge mamba=0.24.0 pip=22.1.2

# Environments created by mamba can't be referenced by name from conda
# (presumably a bug), so we use an explicit path instead.
- mamba env create --prefix $HOME/mamba-env --file environment.yml
- conda activate $HOME/mamba-env
- conda list
- env
- mkdir -p ~/micromamba/pkgs/
- export MAMBA_ROOT_PREFIX=~/micromamba
- export MAMBA_EXE=$(pwd)/micromamba
- . $MAMBA_ROOT_PREFIX/etc/profile.d/micromamba.sh

# Clone repo, create environment, and install xcube
- git clone https://github.com/dcs4cop/xcube $HOME/xcube
- micromamba create --name xc --file $HOME/xcube/environment.yml
- micromamba activate xc
- cd $HOME/xcube
- python setup.py install

# Make sure pytest is installed
- micromamba install --yes --name xc --channel conda-forge pytest attrs

# Print some diagnostics (useful for debugging)
- micromamba list
- xcube --version
- python -c "from xcube import __version__; print(f'xcube version {__version__}')"

# Run the test suite
- pytest -v --cov=xcube

# Setting NUMBA_DISABLE_JIT=1 makes unit tests way too slow, so we accept less code coverage here
# - export NUMBA_DISABLE_JIT=1
- py.test -v --cov=xcube
# - py.test -v --cov=xcube


Loading