-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (60 loc) · 2 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: python ${{ matrix.python-version }} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {python-version: "3.9", os: ubuntu-latest, documentation: True, coverage: True}
- {python-version: "3.10", os: ubuntu-latest, documentation: False, coverage: True}
- {python-version: "3.11", os: ubuntu-latest, documentation: False, coverage: True}
- {python-version: "3.12", os: ubuntu-latest, documentation: False, coverage: False}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Set up python ${{ matrix.python-version }}
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]
- 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
- name: Run unit tests with coverage
run: |
python -m pip install pytest pytest-cov
pytest --cov ebcc/
if: matrix.coverage
- name: Run unit tests
run: |
python -m pip install pytest
pytest
if: ${{ ! matrix.coverage }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
if: matrix.coverage
- name: Deploy documentation
run: mkdocs gh-deploy --force -f docs/mkdocs.yaml
if: matrix.documentation && github.ref == 'refs/heads/master'