Debian Codegraph @

.github/workflows/tests.yaml

raw
1 name: Tests
2 on:
3 pull_request:
4 paths-ignore: ['docs/**', 'README.md', 'CHANGES.rst']
5 push:
6 branches: [main, stable]
7 paths-ignore: ['docs/**', 'README.md', 'CHANGES.rst']
8 permissions: {}
9 concurrency:
10 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11 cancel-in-progress: true
12 jobs:
13 tests:
14 name: ${{ matrix.name || matrix.python }}
15 runs-on: ${{ matrix.os || 'ubuntu-latest' }}
16 strategy:
17 fail-fast: false
18 matrix:
19 include:
20 - {python: '3.15'}
21 - {python: '3.14'}
22 - {python: '3.13'}
23 - {python: '3.12'}
24 - {python: '3.11'}
25 services:
26 dynamodb:
27 image: amazon/dynamodb-local:3.3.0
28 ports:
29 - 8000:8000
30 # health checks
31 options: >-
32 --health-cmd "bash -c 'echo > /dev/tcp/localhost/8000'"
33 --health-interval 10s
34 --health-timeout 5s
35 --health-retries 5
36 memcached:
37 image: memcached:1.6.41
38 ports:
39 - 11212:11211
40 # health checks
41 options: >-
42 --health-cmd "timeout 5 bash -c 'echo > /dev/tcp/127.0.0.1/11211'"
43 --health-interval 10s
44 --health-timeout 5s
45 --health-retries 5
46 mongodb:
47 image: mongo:8.3.1
48 ports:
49 - 27017:27017
50 # health checks
51 options: >-
52 --health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
53 --health-interval 10s
54 --health-timeout 5s
55 --health-retries 5
56 redis:
57 image: redis:8.6.3
58 ports:
59 - 6360:6379
60 # health checks
61 options: >-
62 --health-cmd "redis-cli ping"
63 --health-interval 10s
64 --health-timeout 5s
65 --health-retries 5
66 valkey:
67 image: valkey/valkey:9.0.4
68 ports:
69 - 6370:6379
70 # health checks
71 options: >-
72 --health-cmd "valkey-cli ping"
73 --health-interval 10s
74 --health-timeout 5s
75 --health-retries 5
76 steps:
77 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
78 with:
79 persist-credentials: false
80 - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
81 with:
82 enable-cache: true
83 prune-cache: false
84 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
85 with:
86 python-version: ${{ matrix.python }}
87 allow-prereleases: true
88 - name: install external dependencies
89 run: |
90 sudo apt-get update
91 sudo apt-get install libmemcached-dev
92 - run: uv run --locked --no-default-groups --group dev tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}
93 typing:
94 runs-on: ubuntu-latest
95 steps:
96 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
97 with:
98 persist-credentials: false
99 - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
100 with:
101 enable-cache: true
102 prune-cache: false
103 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
104 with:
105 python-version-file: pyproject.toml
106 - name: install external dependencies
107 run: |
108 sudo apt-get update
109 sudo apt-get install libmemcached-dev
110 - name: cache mypy
111 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
112 with:
113 path: ./.mypy_cache
114 key: mypy|${{ hashFiles('pyproject.toml') }}
115 - run: uv run --locked --no-default-groups --group dev tox run -e typing