From 6a86005b3d6fc0210cc2fae6582d75617a29bed4 Mon Sep 17 00:00:00 2001 From: mdtanker Date: Fri, 14 Jun 2024 10:49:28 +0200 Subject: [PATCH] chore: switch CI from mini-conda to micromamba --- .github/workflows/ci.yml | 35 ++++++++++++++++++++--------------- env/testing_env.yml | 1 + 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32104ed1..6ec52738 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,11 +54,10 @@ jobs: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] runs-on: [ubuntu-latest, macos-latest, windows-latest] - env: FORCE_COLOR: 3 NUMBA_DISABLE_JIT: "1" - + timeout-minutes: 30 steps: # Checkout current git repository - name: Checkout @@ -69,22 +68,28 @@ jobs: - name: Switch to Current Branch run: git checkout ${{ env.BRANCH }} - # Install Mambaforge with conda-forge dependencies - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v3 + - name: Get current week number of year + id: date + run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19 + + # Install Micromamba with conda-forge dependencies + - name: Setup Micromamba + uses: mamba-org/setup-micromamba@v1 with: - activate-environment: polartoolkit environment-file: env/testing_env.yml - python-version: ${{ matrix.python-version }} - channels: conda-forge,nodefaults - channel-priority: strict - miniforge-version: latest - miniforge-variant: Mambaforge - mamba-version: "*" - use-mamba: true - auto-activate-base: false + create-args: >- + python=${{ matrix.python-version }}$ + post-cleanup: "all" + # cache-downloads: false + # # environment cache is persistent for one week. + # cache-environment-key: + # micromamba-environment-${{ steps.date.outputs.date }} + + # Install the package that we want to test + - name: Install the package + run: pip install --no-deps -e . - # Show installed pkg information for postmortem diagnostic + # Show installed pkg information for postmortem diagnostic - name: List installed packages run: mamba list diff --git a/env/testing_env.yml b/env/testing_env.yml index 9354b230..b51bb96b 100644 --- a/env/testing_env.yml +++ b/env/testing_env.yml @@ -1,6 +1,7 @@ name: testing_env channels: - conda-forge + - nodefaults dependencies: - pygmt - pip