Skip to content

Commit

Permalink
Update GitHub Action workflows
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
  • Loading branch information
jules-ch committed Jul 13, 2022
1 parent f2d14ce commit 5b93e4e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 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
4 changes: 3 additions & 1 deletion docs/sphinx/source/whatsnew/v0.9.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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:`1491`)


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

0 comments on commit 5b93e4e

Please sign in to comment.