Repository navigation
153 lines (129 loc) · 4.37 KB
/
Copy pathci.yml
File metadata and controls
153 lines (129 loc) · 4.37 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on:
pull_request:
push:
branches: [master]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- name: Sync dependencies
run: uv sync --frozen --all-extras --all-groups
- name: Run pre-commit
run: pre-commit run --all-files
unit:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14", "3.15"]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- name: Install Python ${{ matrix.python-version }}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: uv python install "$PYTHON_VERSION"
- name: Sync dependencies
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: uv sync --frozen --all-extras --all-groups --python "$PYTHON_VERSION"
- name: Run unit tests
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
set -euo pipefail
uv run --python "$PYTHON_VERSION" coverage run -m pytest -m "not integration and not v2_5" -vv
uv run --python "$PYTHON_VERSION" coverage report --fail-under=0
integration:
name: Integration tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14", "3.15"]
services:
rethinkdb:
image: rethinkdb:2.4.4-bookworm-slim
ports:
- 28015:28015
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- name: Install Python ${{ matrix.python-version }}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: uv python install "$PYTHON_VERSION"
- name: Sync dependencies
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: uv sync --frozen --all-extras --all-groups --python "$PYTHON_VERSION"
- name: Wait for RethinkDB
run: |
set -euo pipefail
for _ in $(seq 1 30); do
if bash -c 'echo > /dev/tcp/127.0.0.1/28015' 2>/dev/null; then
exit 0
fi
sleep 1
done
echo "RethinkDB did not accept connections on port 28015" >&2
exit 1
- name: Run integration tests
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: uv run --python "$PYTHON_VERSION" pytest -m "integration and not v2_5" -vv
docs:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- name: Sync dependencies
run: uv sync --frozen --all-extras --all-groups
- name: Build documentation
run: uv run sphinx-build -b html docs docs/_build/html
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Review dependencies
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0