Add downstream ci #261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: on-push | |
on: [push, pull_request] | |
jobs: | |
unit-tests: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu] | |
python: ["3.7", "3.8", "3.9", "3.10"] | |
extras: [''] | |
include: | |
- os: macos | |
python: "3.8" | |
- os: ubuntu | |
python: "3.8" | |
extras: -minimal | |
# python-eccodes and cffi both fail | |
# - os: windows | |
# python: 3.8 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.4.3-0' | |
environment-name: ${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }} | |
environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}.yml | |
create-args: python=${{ matrix.python }} | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
micromamba install pytest pytest-cov tomli | |
pip install --no-deps -e . | |
pytest -v --cov=. --cov-report=xml -k 'not test_notebooks' . | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
- name: Install test tools for notebooks | |
shell: bash -l {0} | |
run: | | |
micromamba install pytest nbformat nbconvert ipykernel | |
pytest -v -k 'test_notebooks' . | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.4.3-0' | |
environment-name: ubuntu-3.8 | |
environment-file: tests/environment-ubuntu-3.8.yml | |
create-args: python=${{ matrix.python }} | |
- name: Build documentation with Sphinx | |
shell: bash -l {0} | |
run: | | |
micromamba install sphinx | |
micromamba install sphinx_rtd_theme -c conda-forge | |
micromamba install ipykernel | |
micromamba install pandoc | |
micromamba install nbsphinx | |
micromamba install ipython_genutils | |
micromamba install jinja2=3.0.3 | |
pip install --no-deps -e . | |
python setup.py build_sphinx | |
# - name: Test README with pytest | |
# shell: bash -l {0} | |
# run: | | |
# conda install pytest pytest-cov tomli | |
# pip install --no-deps -e . | |
# pytest -v --cov=. --cov-report=xml README.rst | |
code-quality: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.4.3-0' | |
environment-name: ubuntu-3.8 | |
environment-file: tests/environment-ubuntu-3.8.yml | |
create-args: python=3.8 | |
- name: Lint with flake8 | |
shell: bash -l {0} | |
run: | | |
micromamba install flake8 | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Type check with mypy | |
shell: bash -l {0} | |
run: | | |
micromamba install mypy pytest | |
mypy --strict . | |
code-style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.4.3-0' | |
environment-name: ubuntu-3.8 | |
environment-file: tests/environment-ubuntu-3.8.yml | |
create-args: python=3.8 | |
- name: Check code style with black | |
shell: bash -l {0} | |
run: | | |
micromamba install black | |
black --check . | |
- name: Check code style with isort | |
shell: bash -l {0} | |
run: | | |
micromamba install isort | |
isort --check . | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.4.3-0' | |
environment-name: ubuntu-3.8 | |
environment-file: tests/environment-ubuntu-3.8.yml | |
create-args: python=3.8 | |
- name: Check MANIFEST.in | |
shell: bash -l {0} | |
run: | | |
micromamba install -c conda-forge check-manifest | |
check-manifest . | |
- name: Build distributions | |
shell: bash -l {0} | |
run: | | |
micromamba install pip setuptools wheel | |
python setup.py sdist bdist_wheel |