Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mamba + pytest-xdist to speed up CI testing #515

Merged
merged 13 commits into from
Nov 2, 2020
34 changes: 21 additions & 13 deletions .github/workflows/climpred_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,36 @@ jobs:
test: # Runs testing suite on various python versions.
name: Test climpred, python ${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install Conda environment
- name: Set up conda
uses: conda-incubator/setup-miniconda@v1
with:
auto-update-conda: true
channels: conda-forge
mamba-version: '*'
activate-environment: climpred-minimum-tests
environment-file: ci/requirements/minimum-tests.yml
python-version: ${{ matrix.python-version }}
- name: Set up conda environment
run: |
mamba env update -f ci/requirements/minimum-tests.yml
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Run tests
shell: bash -l {0}
run: |
conda activate climpred-minimum-tests
pytest --cov=climpred --cov-report=xml
pytest --cov=climpred --cov-report=xml --verbose
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1.0.7
with:
Expand All @@ -41,28 +45,32 @@ jobs:

docs_notebooks: # Checks that pre-compiled notebooks in docs still work.
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install Conda environment
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v1
with:
auto-update-conda: true
channels: conda-forge
mamba-version: '*'
activate-environment: climpred-docs-notebooks
environment-file: ci/requirements/docs_notebooks.yml
python-version: 3.6
- name: Set up conda environment
run: |
mamba env update -f ci/requirements/docs_notebooks.yml
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Test notebooks in docs
shell: bash -l {0}
run: |
pushd docs
nbstripout source/*.ipynb source/examples/decadal/*.ipynb source/examples/subseasonal/*.ipynb
make html
make -j4 html
popd
19 changes: 13 additions & 6 deletions ci/requirements/minimum-tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: climpred-minimum-tests
channels:
- conda-forge
- defaults
dependencies:
- xesmf
- esmpy
bradyrx marked this conversation as resolved.
Show resolved Hide resolved
- cftime>=1.1.2
- coveralls
- dask
- netcdf4
- eofs
- esmpy=*=mpi*
- esmtools>=1.1.3
- ipython
- matplotlib
- nc-time-axis
- coveralls
- netcdf4
- pip
- pytest
- pytest-cov
- pip
- scipy
- xarray>=0.16.1
- xesmf
- xrft
- xskillscore>=0.0.18
- pip:
- pytest-lazy-fixture
- -e ../..
Loading