Skip to content

Commit 8840460

Browse files
authored
Add a simple integration test (#275)
1 parent 8c8b000 commit 8840460

File tree

2 files changed

+60
-29
lines changed

2 files changed

+60
-29
lines changed

.github/workflows/test.yml

+59-28
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,73 @@
11
name: Test
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
47

58
permissions: {}
69

710
env:
811
FORCE_COLOR: 1
912

1013
jobs:
11-
test:
12-
runs-on: ${{ matrix.os }}
14+
integration:
15+
name: Integration test
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.13"
24+
25+
- name: Set up requirements
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install -r requirements.txt
29+
30+
- name: Build documentation
31+
run: >
32+
python ./build_docs.py
33+
--quick
34+
--build-root ./build_root
35+
--www-root ./www
36+
--log-directory ./logs
37+
--group "$(id -g)"
38+
--skip-cache-invalidation
39+
--languages en
40+
--branches 3.14
41+
42+
unit:
43+
name: Unit tests
44+
runs-on: ubuntu-latest
1345
strategy:
1446
fail-fast: false
1547
matrix:
16-
python-version: ["3.13", "3.14"]
17-
os: [ubuntu-latest]
48+
python-version:
49+
- "3.13"
50+
- "3.14"
1851

1952
steps:
20-
- uses: actions/checkout@v4
21-
with:
22-
persist-credentials: false
23-
24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
allow-prereleases: true
29-
30-
- name: Install uv
31-
uses: hynek/setup-cached-uv@v2
32-
33-
- name: Tox tests
34-
run: |
35-
uvx --with tox-uv tox -e py
36-
37-
- name: Upload coverage
38-
uses: codecov/codecov-action@v5
39-
with:
40-
flags: ${{ matrix.os }}
41-
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
42-
token: ${{ secrets.CODECOV_ORG_TOKEN }}
53+
- uses: actions/checkout@v4
54+
with:
55+
persist-credentials: false
56+
57+
- name: Set up Python ${{ matrix.python-version }}
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
allow-prereleases: true
62+
63+
- name: Install uv
64+
uses: hynek/setup-cached-uv@v2
65+
66+
- name: Tox tests
67+
run: uvx --with tox-uv tox -e py
68+
69+
- name: Upload coverage
70+
uses: codecov/codecov-action@v5
71+
with:
72+
name: Python ${{ matrix.python-version }}
73+
token: ${{ secrets.CODECOV_ORG_TOKEN }}

build_docs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ def parse_args() -> argparse.Namespace:
10431043
def setup_logging(log_directory: Path, select_output: str | None) -> None:
10441044
"""Setup logging to stderr if run by a human, or to a file if run from a cron."""
10451045
log_format = "%(asctime)s %(levelname)s: %(message)s"
1046-
if sys.stderr.isatty():
1046+
if sys.stderr.isatty() or "CI" in os.environ:
10471047
logging.basicConfig(format=log_format, stream=sys.stderr)
10481048
else:
10491049
log_directory.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)