-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.41 KB
/
tests.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
name: CI
on:
pull_request:
push:
branches:
- main
- "dev*"
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8, 3.11]
steps:
- name: Checkout repository
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: Update pip and install the package
run: |
python -m pip install --upgrade pip
python -m pip install ".[test]"
- name: Run tests
run: |
python -m pytest tests --cov=census21api --cov-fail-under=100
- name: Test documentation
if: matrix.os == 'ubuntu-latest'
run: |
python -m pip install ".[docs]"
python -m doctest README.md
python -m pytest docs \
--nbval \
--nbval-current-env \
--randomly-dont-reorganize \
--cov=census21api \
--cov-config=.docscoveragerc \
--cov-fail-under=99
- name: Install and run linters
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
run: |
python -m pip install ".[lint]"
python -m black --check .
python -m ruff .