-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (76 loc) · 2.08 KB
/
ci_tests.yml
File metadata and controls
80 lines (76 loc) · 2.08 KB
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
70
71
72
73
74
75
76
77
78
79
80
name: CI Tests
on:
- push
- pull_request
- workflow_dispatch
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
py: ['3.9', '3']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.py }}
check-latest: True
- name: Install dependencies
run: |
python -m pip install ".[test]"
- name: Run the unit tests
shell: bash
run: |
coverage run -p -m unittest discover -b tests
- name: Run the Python linter
run: |
prospector
- name: Upload coverage artifact
uses: actions/upload-artifact@v6
with:
name: coverage-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.py }}
path: .coverage.*
include-hidden-files: true
upload-coverage:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3'
check-latest: true
- name: Download coverage artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Combine coverage files
run: |
python -m pip install ".[test]"
find artifacts -name ".coverage.*" -exec mv {} . \;
coverage combine
coverage xml
coverage report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
build-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3'
check-latest: true
- name: Build documentation
run: |
python -m pip install ".[docs]"
sphinx-build -W -b html docs docs/_build/html
sphinx-build -W -b doctest docs docs/_build/doctest
sphinx-build -W -b linkcheck docs docs/_build/linkcheck