Skip to content

Update ci

Update ci #1

Workflow file for this run

name: legacy-ci
on:
push:
branches:
- main
- develop
tags:
- "*"
pull_request:
branches:
- main
- develop
pull_request_target:
types: [labeled]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
pre-commit:
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.0
documentation:
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: environment.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
cache-env-key: ubuntu-latest-3.10
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Build documentation
run: |
make docs-build
# on: push
# 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