Skip to content

Commit

Permalink
Update GitHub Action workflows to use micromamba (#1493)
Browse files Browse the repository at this point in the history
- Replace conda setup with micromamba
- Reduce fetch depth for checkout
- Fetch tags for version inference
- Install pvlib from source before testing

Closes #1472

Co-authored-by: Kevin Anderson <kevin.anderson@nrel.gov>
  • Loading branch information
jules-ch and kandersolar authored Jul 19, 2022
1 parent c3016f1 commit 59cbae7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
test:

strategy:
fail-fast: false # don't cancel other matrix jobs when one fails
matrix:
Expand All @@ -31,16 +30,23 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
# We check out only a limited depth and then pull tags to save time
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up conda environment
- name: Install Conda environment with Micromamba
if: matrix.environment-type == 'conda'
uses: conda-incubator/setup-miniconda@v2
uses: mamba-org/provision-with-micromamba@v12
with:
activate-environment: test_env
environment-file: ${{ env.REQUIREMENTS }}
python-version: ${{ matrix.python-version }}
auto-activate-base: false
cache-downloads: true
extra-specs: |
python=${{ matrix.python-version }}
env:
# build requirement filename. First replacement is for the python
# version, second is to add "-min" if needed
Expand All @@ -49,14 +55,19 @@ jobs:
- name: List installed package versions (conda)
if: matrix.environment-type == 'conda'
shell: bash -l {0} # necessary for conda env to be active
run: conda list
run: micromamba list

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

- name: Install pvlib
if: matrix.environment-type == 'conda'
shell: bash -l {0}
run: python -m pip install --no-deps .

- name: Set up bare environment
if: matrix.environment-type == 'bare'
run: |
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bug fixes
Testing
~~~~~~~
* Switched CI testing provider from Azure to GitHub Actions (:pull:`1306`)
* Speed up CI setup using micromamba instead of conda (:pull:`1493`)


Documentation
Expand Down Expand Up @@ -56,3 +57,4 @@ Contributors
* Prajwal Borkar (:ghuser:`PrajwalBorkar`)
* Kevin Anderson (:ghuser:`kanderso-nrel`)
* Cliff Hansen (:ghuser:`cwhanse`)
* Jules Chéron (:ghuser:`jules-ch`)

0 comments on commit 59cbae7

Please sign in to comment.