-
Notifications
You must be signed in to change notification settings - Fork 16
72 lines (63 loc) · 1.88 KB
/
tests.yaml
File metadata and controls
72 lines (63 loc) · 1.88 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
name: continuous-integration
on:
pull_request:
push:
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
# ref: https://github.com/pre-commit/action
- uses: pre-commit/action@v3.0.1
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
echo "You can install pre-commit hooks to automatically run formatting"
echo "on each commit with:"
echo " pre-commit install"
echo "or you can run by hand on staged files with"
echo " pre-commit run"
echo "or after-the-fact on already committed files with"
echo " pre-commit run --all-files"
tests:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
# Only test oldest supported and latest python version to reduce
# GitHub API calls, as they can get rate limited
- python-version: 3.9
- python-version: 3.x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[testing]
- name: Run tests
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pytest --verbose --color=yes --durations=10
docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[sphinx]
- name: Build docs
run: |
cd docs
make dirhtml