| 1 |
name: Tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
- "*.x" |
| 7 |
paths-ignore: |
| 8 |
- "docs/**" |
| 9 |
- "*.md" |
| 10 |
- "*.rst" |
| 11 |
pull_request: |
| 12 |
paths-ignore: |
| 13 |
- "docs/**" |
| 14 |
- "*.md" |
| 15 |
- "*.rst" |
| 16 |
jobs: |
| 17 |
tests: |
| 18 |
name: ${{ matrix.name || matrix.python }} |
| 19 |
runs-on: ${{ matrix.os || 'ubuntu-latest' }} |
| 20 |
strategy: |
| 21 |
fail-fast: false |
| 22 |
matrix: |
| 23 |
include: |
| 24 |
- { python: "3.14" } |
| 25 |
- { python: "3.13" } |
| 26 |
- { python: "3.12" } |
| 27 |
- { python: "3.11" } |
| 28 |
services: |
| 29 |
memcached: |
| 30 |
image: memcached:1.6.41 |
| 31 |
ports: |
| 32 |
- 11212:11211 |
| 33 |
# health checks |
| 34 |
options: >- |
| 35 |
--health-cmd "timeout 5 bash -c 'echo > /dev/tcp/127.0.0.1/11211'" |
| 36 |
--health-interval 10s |
| 37 |
--health-timeout 5s |
| 38 |
--health-retries 5 |
| 39 |
redis: |
| 40 |
image: redis:8.6.3 |
| 41 |
ports: |
| 42 |
- 6360:6379 |
| 43 |
# health checks |
| 44 |
options: >- |
| 45 |
--health-cmd "redis-cli ping" |
| 46 |
--health-interval 10s |
| 47 |
--health-timeout 5s |
| 48 |
--health-retries 5 |
| 49 |
steps: |
| 50 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 51 |
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 |
| 52 |
with: |
| 53 |
enable-cache: true |
| 54 |
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 55 |
with: |
| 56 |
python-version: ${{ matrix.python }} |
| 57 |
allow-prereleases: true |
| 58 |
- name: install external dependencies |
| 59 |
run: | |
| 60 |
sudo apt-get update |
| 61 |
sudo apt-get install -y libmemcached-dev |
| 62 |
- run: uv sync --group dev --group tests |
| 63 |
- run: uv run tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} |