-
Notifications
You must be signed in to change notification settings - Fork 16
82 lines (72 loc) · 2.32 KB
/
tests.yaml
File metadata and controls
82 lines (72 loc) · 2.32 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
81
82
name: continuous-integration
on:
# pull_request_target makes secrets available in the PR, so we avoid rate limits
# YOU MUST MERGE THE PR to test changes to this file. GitHub run the version on `main`.
pull_request_target:
push:
branches: [main]
tags:
- "v*"
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: 3.13
# ref: https://github.com/pre-commit/action
- uses: pre-commit/[email protected]
- 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
environment: pr-tests
env:
# This is a private access token for @choldgraf that has public read-only access.
# FUTURE: We should update the tests to only pull from this repository and not
# need a token at all.
GITHUB_ACCESS_TOKEN: "${{ secrets.TOKEN_READONLY }}"
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.10"
- python-version: 3.x
steps:
- uses: actions/checkout@v5
- 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
run: pytest --verbose --color=yes --durations=10
docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- 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