generated from scottclowe/python-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 15
69 lines (58 loc) · 1.79 KB
/
test.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
65
66
67
68
69
# Regular tests
#
# Use this to ensure your tests are passing on every push and PR (skipped on
# pushes which only affect documentation).
# There is also a cron job set to run weekly on the default branch, to check
# against dependency chain rot.
#
# You should make sure you run jobs on at least the *oldest* and the *newest*
# versions of python that your codebase is intended to support.
name: tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 1"
branches: [ $default-branch ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: System information
run: python .github/workflows/system_info.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install --editable .[test]
- name: Debug environment
run: python -m pip freeze
- name: Test with pytest
run: |
python -m pip install pytest
python -m pip install pytest-cov
python -m pytest --cov=eodal --cov-report term --cov-report xml --cov-config .coveragerc --junitxml=testresults.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}
- name: Build HTML docs
run: |
python -m pip install --editable .[docs]
cd docs
make html
cd ..