Skip to content

Commit d0199dd

Browse files
committed
Update GitHub Action workflows
- Replace conda setup with micromamba - Reduce fetch depth for checkout - Fetch tags for version inference - Install pvlib from source before testing Closes pvlib#1472
1 parent f2d14ce commit d0199dd

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.github/workflows/pytest.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
test:
11-
1211
strategy:
1312
fail-fast: false # don't cancel other matrix jobs when one fails
1413
matrix:
@@ -31,16 +30,23 @@ jobs:
3130
runs-on: ${{ matrix.os }}
3231

3332
steps:
34-
- uses: actions/checkout@v3
33+
# We check out only a limited depth and then pull tags to save time
34+
- name: Checkout source
35+
uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 100
38+
39+
- name: Get tags
40+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3541

36-
- name: Set up conda environment
42+
- name: Install Conda environment with Micromamba
3743
if: matrix.environment-type == 'conda'
38-
uses: conda-incubator/setup-miniconda@v2
44+
uses: mamba-org/provision-with-micromamba@v12
3945
with:
40-
activate-environment: test_env
4146
environment-file: ${{ env.REQUIREMENTS }}
42-
python-version: ${{ matrix.python-version }}
43-
auto-activate-base: false
47+
cache-downloads: true
48+
extra-specs: |
49+
python=${{ matrix.python-version }}
4450
env:
4551
# build requirement filename. First replacement is for the python
4652
# version, second is to add "-min" if needed
@@ -49,14 +55,19 @@ jobs:
4955
- name: List installed package versions (conda)
5056
if: matrix.environment-type == 'conda'
5157
shell: bash -l {0} # necessary for conda env to be active
52-
run: conda list
58+
run: micromamba list
5359

5460
- name: Install bare Python ${{ matrix.python-version }}${{ matrix.suffix }}
5561
if: matrix.environment-type == 'bare'
5662
uses: actions/setup-python@v1
5763
with:
5864
python-version: ${{ matrix.python-version }}
5965

66+
- name: Install pvlib
67+
if: matrix.environment-type == 'conda'
68+
shell: bash -l {0}
69+
run: python -m pip install --no-deps .
70+
6071
- name: Set up bare environment
6172
if: matrix.environment-type == 'bare'
6273
run: |

docs/sphinx/source/whatsnew/v0.9.2.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Bug fixes
2626
Testing
2727
~~~~~~~
2828
* Switched CI testing provider from Azure to GitHub Actions (:pull:`1306`)
29+
* Speed up CI setup using micromamba instead of conda (:pull:`1493`)
2930

3031

3132
Documentation
@@ -51,4 +52,5 @@ Contributors
5152
* Chencheng Luo (:ghuser:`roger-lcc`)
5253
* Prajwal Borkar (:ghuser:`PrajwalBorkar`)
5354
* Kevin Anderson (:ghuser:`kanderso-nrel`)
54-
* Cliff Hansen (:ghuser:`cwhanse`)
55+
* Cliff Hansen (:ghuser:`cwhanse`)
56+
* Jules Chéron (:ghuser:`jules-ch`)

0 commit comments

Comments
 (0)