-
Notifications
You must be signed in to change notification settings - Fork 62
61 lines (55 loc) · 1.66 KB
/
checks.yml
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
name: Continuous integration
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '0 2 * * *'
# template mostly borrowed from openscm-runner
# https://github.com/openscm/openscm-runner
jobs:
all:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies
run: |
pip install --upgrade pip wheel
pip install -e .[dev-nodocs]
- name: Formatting and linters
run: |
bandit -c .bandit.yml -r src/fair
black --check src setup.py --exclude fair/_version.py
isort --check-only --quiet --recursive src setup.py
pydocstyle src
flake8 src setup.py
# pylint src
# test readthedocs build... how?
- name: Test with pytest
env:
MIN_COVERAGE: 90
run: |
pytest tests -r a --cov=./src/fair --cov-report=xml
if ! coverage report --fail-under=${MIN_COVERAGE} --show-missing
then
echo
echo "Error: Test coverage has to be at least ${MIN_COVERAGE}"
exit 1
fi
# we could run the notebook tests, but we probably don't want to do this every
# time and use all our minutes.
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}