Debian Codegraph @

.github/workflows/tests.yml

raw
1
2
3 name: tests
4 permissions:
5 contents: read
6 on:
7 push:
8 branches:
9 - main
10 - "[0-9]+.[0-9]+.x"
11 pull_request:
12 branches:
13 - main
14 - "[0-9]+.[0-9]+.x"
15
16 # Allows you to run this workflow manually from the Actions tab
17 workflow_dispatch:
18
19 jobs:
20 tests:
21 runs-on: ubuntu-latest
22 strategy:
23 fail-fast: false
24 matrix:
25 include:
26 - {python: '3.10', tox: 'py310-release'}
27 - {python: '3.10', tox: 'py310-low'}
28 - {python: '3.11', tox: 'py311-release'}
29 - {python: '3.11', tox: 'py311-low'}
30 - {python: '3.12', tox: 'py312-release' }
31 - {python: '3.12', tox: 'py312-low' }
32 - {python: '3.13', tox: 'py313-release' }
33 - {python: '3.13', tox: 'py313-low' }
34 - {python: '3.14', tox: 'py314-release' }
35 - {python: 'pypy-3.10', tox: 'pypy310-release'}
36 - {python: 'pypy-3.10', tox: 'pypy310-low'}
37
38 steps:
39 - uses: actions/checkout@v6
40 - uses: actions/setup-python@v6
41 with:
42 python-version: ${{ matrix.python }}
43 - name: update pip
44 run: |
45 python -m pip install -U pip
46 - name: cache pip
47 uses: actions/cache@v5
48 with:
49 path: ~/.cache/pip
50 key: pip-${{ runner.os }}-${{ matrix.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*.txt') }}
51 - name: run tests
52 run: |
53 pip install tox
54 tox -e ${{ matrix.tox }}
55
56 lint:
57 runs-on: ubuntu-latest
58 steps:
59 - uses: actions/checkout@v6
60 - uses: actions/setup-python@v6
61 with:
62 python-version: "3.13"
63 - name: update pip
64 run: |
65 python -m pip install -U pip
66 - name: Style, docs, mypy
67 run: |
68 pip install tox
69 tox -e style,docs,mypy
70
71 other:
72 runs-on: ubuntu-latest
73 steps:
74 - uses: actions/checkout@v6
75 - uses: actions/setup-python@v6
76 with:
77 python-version: "3.13"
78 - name: update pip
79 run: |
80 python -m pip install -U pip
81 - name: nobabel, nowebauthn, noauthlib, noflasksqlalchemy, async
82 run: |
83 pip install tox
84 tox -e nobabel,nowebauthn,noauthlib,noflasksqlalchemy,async
85 cov:
86 runs-on: ubuntu-latest
87 steps:
88 - uses: actions/checkout@v6
89 - uses: actions/setup-python@v6
90 with:
91 python-version: "3.13"
92 - name: update pip
93 run: |
94 python -m pip install -U pip
95 - name: Coverage
96 run: |
97 pip install tox coverage
98 tox -e coverage
99 - name: Upload coverage to Codecov
100 uses: codecov/codecov-action@v6
101 with:
102 fail_ci_if_error: true
103 verbose: true
104 token: ${{ secrets.codecov_token }}
105 realdb:
106 runs-on: ubuntu-latest
107
108 services:
109 postgres:
110 image: postgres:latest
111 env:
112 POSTGRES_USER: postgres
113 POSTGRES_PASSWORD: testpw
114 POSTGRES_DB: testdb
115 ports:
116 - 5432:5432
117 options: >-
118 --health-cmd pg_isready
119 --health-interval 10s
120 --health-timeout 5s
121 --health-retries 5
122 steps:
123 - uses: actions/checkout@v6
124 - uses: actions/setup-python@v6
125 with:
126 python-version: "3.13"
127 - name: update pip
128 run: |
129 python -m pip install -U pip
130 - name: cache pip
131 uses: actions/cache@v5
132 with:
133 path: ~/.cache/pip
134 key: pip-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*.txt') }}
135 - name: Postgres
136 run: |
137 pip install tox
138 tox -e realpostgres -- --realdburl='postgresql://postgres:testpw@localhost:5432/testdb'