Skip to content

Commit

Permalink
Merge pull request #128 from zmoon/setup-micromamba
Browse files Browse the repository at this point in the history
CI: Move to `setup-micromamba`
  • Loading branch information
zmoon authored Aug 3, 2023
2 parents 5acbc95 + 0f3b40c commit 961625a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
52 changes: 36 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,54 @@ on:

jobs:
test:
name: Test
name: Test (Py ${{ matrix.python-version }}${{ matrix.aqs && ', AQS' || '' }})
runs-on: ubuntu-latest
if: github.repository == 'noaa-oar-arl/monetio'
strategy:
matrix:
python-version: ["3.6", "3.8", "3.10"]
python-version: ["3.8", "3.10"]
aqs: [false]
include:
- python-version: "3.6"
aqs: true
- python-version: "3.10"
aqs: true
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- name: Set up Python (micromamba)
uses: mamba-org/provision-with-micromamba@v16
- name: Set up Python (micromamba) [>3.6, no AQS]
if: matrix.python-version != '3.6' && !matrix.aqs
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Set up Python (micromamba) [>3.6, AQS]
if: matrix.python-version != '3.6' && matrix.aqs
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
cache-env: true
extra-specs: |
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
openssl=1.1.1u
- name: Adjust conda env for Python 3.6
- name: Set up Python (micromamba) [3.6, AQS]
if: matrix.python-version == '3.6'
run: micromamba install attrs=22.2.0
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
attrs=22.2.0
openssl=1.1.1u
- name: Test with pytest
run: pytest -n auto -v
Expand All @@ -44,15 +68,11 @@ jobs:
pip install https://github.com/noaa-oar-arl/pytspack/archive/master.zip
pytest -n auto -v -k with_pytspack
- name: Downgrade OpenSSL and test AQS
- name: Test AQS
if: matrix.aqs
run: |
micromamba install 'openssl <3'
pytest -n auto -v -k aqs
- name: Restore current openssl
if: success() || failure()
run: micromamba update openssl

docs:
name: Check docs build
runs-on: ubuntu-latest
Expand All @@ -65,10 +85,10 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python (micromamba)
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: docs/environment-docs.yml
cache-env: true
cache-environment: true

- name: Downgrade OpenSSL (for AQS URL linkcheck)
run: micromamba install 'openssl <3'
Expand Down
2 changes: 1 addition & 1 deletion docs/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.9
- python=3.10
#
# core
- dask
Expand Down

0 comments on commit 961625a

Please sign in to comment.