Skip to content

External corrections #351

External corrections

External corrections #351

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install ebcc
run: |
python -m pip install wheel
python -m pip install .[dev]
- name: Linting
run: |
python -m black ebcc/ --diff --check --verbose
python -m isort ebcc/ --diff --check-only --verbose
python -m flake8 ebcc/ --verbose
python -m mypy ebcc/ --verbose
test:
needs: lint
name: Tests for ${{ matrix.os }}, python ${{ matrix.python-version }}, ${{ matrix.backend }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {python-version: "3.9", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True}
- {python-version: "3.10", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True}
- {python-version: "3.11", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True}
- {python-version: "3.12", backend: "numpy", os: ubuntu-latest, coverage: False, minimal: True, full: True}
- {python-version: "3.12", backend: "tensorflow", os: ubuntu-latest, coverage: False, minimal: True, full: False}
- {python-version: "3.12", backend: "jax", os: ubuntu-latest, coverage: False, minimal: True, full: False}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install ebcc
run: |
python -m pip install wheel
python -m pip install .[dev,numpy,jax,tensorflow]
- name: Run minimal unit tests
run: |
python -m pip install pytest
EBCC_BACKEND=${{ matrix.backend }} pytest tests/test_minimal.py
if: matrix.minimal
- name: Run unit tests
run: |
python -m pip install pytest
EBCC_BACKEND=${{ matrix.backend }} pytest
if: matrix.full && ! matrix.coverage
- name: Run unit tests with coverage
run: |
python -m pip install pytest pytest-cov
EBCC_BACKEND=${{ matrix.backend }} pytest --cov ebcc/
if: matrix.full && matrix.coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
if: matrix.coverage
docs:
needs: lint
name: Documentation
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install ebcc
run: |
python -m pip install wheel
python -m pip install -e .[dev]
- name: Deploy documentation
run: mkdocs gh-deploy --force -f docs/mkdocs.yaml