Skip to content

Commit

Permalink
Switch CI to micromamba (#577)
Browse files Browse the repository at this point in the history
* Switch CI to micromamba

Towards #576

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* py3.11 still causes trouble...

* pin upstream python version to <3.11

* Update whats-new.rst

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jbusecke and pre-commit-ci[bot] committed Jan 27, 2023
1 parent c13eb7b commit 0a130d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 51 deletions.
76 changes: 25 additions & 51 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
schedule:
- cron: "0 13 * * 1"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
Expand All @@ -25,25 +29,15 @@ jobs:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3.0.11
env:
# Increase this value to reset cache if ci/environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
with:
channels: conda-forge
mamba-version: '*'
channel-priority: strict
activate-environment: test_env_xgcm # Defined in ci/environment.yml
auto-update-conda: false
python-version: ${{ matrix.python-version }}
cache-downloads: true
micromamba-version: 'latest'
environment-file: ci/environment.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Set up conda environment
extra-specs: |
python=${{ matrix.python-version }}
- name: Install XGCM
run: |
python -m pip install -e . --no-deps
conda list
Expand All @@ -69,25 +63,15 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3.0.11
env:
# Increase this value to reset cache if ci/environment-core-deps.yml has not changed
CACHE_NUMBER: 0
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-core-deps.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
mamba-version: '*'
channel-priority: strict
activate-environment: test_env_xgcm # Defined in ci/environment.yml
auto-update-conda: false
python-version: "3.10"
cache-downloads: true
micromamba-version: 'latest'
environment-file: ci/environment-core-deps.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Set up conda environment
extra-specs: |
python=${{ matrix.python-version }}
- name: Install XGCM
run: |
python -m pip install -e . --no-deps
conda list
Expand All @@ -105,25 +89,15 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3.0.11
env:
# Increase this value to reset cache if ci/environment-upstream-dev.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-upstream-dev.yml') }}
- uses: conda-incubator/setup-miniconda@v2
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
with:
channels: conda-forge
mamba-version: '*'
channel-priority: strict
activate-environment: test_env_xgcm # Defined in ci/environment.yml
auto-update-conda: false
python-version: "3.10"
cache-downloads: true
micromamba-version: 'latest'
environment-file: ci/environment-upstream-dev.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Set up conda environment
extra-specs: |
python=<3.11
- name: Install XGCM
run: |
python -m pip install -e . --no-deps
conda list
Expand Down
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Breaking Changes

Internal Changes
~~~~~~~~~~~~~~~~
- Switch CI environment setup to micromamba (:issue:`576`, :pull:`577`).
By `Julius Busecke <https://github.com/jbusecke>`_.

- pre-commit autoupdate frequency reduced (:pull:`563`).
By `Julius Busecke <https://github.com/jbusecke>`_.

Expand Down

0 comments on commit 0a130d1

Please sign in to comment.