Skip to content

Commit

Permalink
Merge pull request #117 from jGaboardi/micromamba_CI
Browse files Browse the repository at this point in the history
implement micromamba for CI
  • Loading branch information
jGaboardi authored Apr 26, 2021
2 parents d226d22 + 11cef31 commit fa5c2b3
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,34 @@

jobs:
unittests:
name: conda (${{ matrix.os }}, ${{ matrix.environment-file }})
name: micromamba (${{ matrix.os }}, ${{ matrix.environment-file }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
environment-file: [ci/36.yaml, ci/37.yaml, ci/38.yaml, ci/39.yaml]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
- uses: conda-incubator/setup-miniconda@v2
- name: checkout repo
uses: actions/checkout@v2

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
with:
miniconda-version: 'latest'
mamba-version: "*"
channels: conda-forge
channel-priority: true
auto-update-conda: false
auto-activate-base: false
environment-file: ${{ matrix.environment-file }}
activate-environment: test
use-only-tar-bz2: true
- run: mamba info --all
- run: mamba list
- run: pytest -v nhgisxwalk --cov=nhgisxwalk --doctest-modules --cov-config=.coveragerc --cov-report=xml
- name: codecov (${{ matrix.os }}, ${{ matrix.environment-file }})
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: run tests - bash
shell: bash -l {0}
run: pytest -v nhgisxwalk --cov=nhgisxwalk --doctest-modules --cov-config=.coveragerc --cov-report=xml
if: matrix.os != 'windows-latest'

- name: run tests - powershell
shell: powershell
run: pytest -v nhgisxwalk --cov=nhgisxwalk --doctest-modules --cov-config=.coveragerc --cov-report=xml
if: matrix.os == 'windows-latest'

- name: codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit fa5c2b3

Please sign in to comment.