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.11', tox: 'py311-release'}
27 - {python: '3.11', tox: 'py311-low'}
28 - {python: '3.12', tox: 'py312-release' }
29 - {python: '3.12', tox: 'py312-low' }
30 - {python: '3.13', tox: 'py313-release' }
31 - {python: '3.13', tox: 'py313-low' }
32 - {python: '3.14', tox: 'py314-release' }
33
34 steps:
35 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
36 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
37 with:
38 python-version: ${{ matrix.python }}
39 - name: update pip
40 run: |
41 python -m pip install -U pip
42 - name: cache pip
43 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
44 with:
45 path: ~/.cache/pip
46 key: pip-${{ runner.os }}-${{ matrix.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }} }}
47 - name: run tests
48 run: |
49 pip install tox
50 tox -e ${{ matrix.tox }}
51
52 lint:
53 runs-on: ubuntu-latest
54 steps:
55 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
57 with:
58 python-version: "3.13"
59 - name: update pip
60 run: |
61 python -m pip install -U pip
62 - name: Style, docs, mypy
63 run: |
64 pip install tox
65 tox -e style,docs,mypy
66
67 other:
68 runs-on: ubuntu-latest
69 steps:
70 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
71 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
72 with:
73 python-version: "3.13"
74 - name: update pip
75 run: |
76 python -m pip install -U pip
77 - name: nobabel, nowebauthn, noauthlib, noflasksqlalchemy, async
78 run: |
79 pip install tox
80 tox -e nobabel,nowebauthn,noauthlib,noflasksqlalchemy,async
81 cov:
82 runs-on: ubuntu-latest
83 steps:
84 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
85 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
86 with:
87 python-version: "3.13"
88 - name: update pip
89 run: |
90 python -m pip install -U pip
91 - name: Coverage
92 run: |
93 pip install tox coverage
94 tox -e coverage
95 - name: Upload coverage to Codecov
96 uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
97 with:
98 fail_ci_if_error: true
99 verbose: true
100 token: ${{ secrets.codecov_token }}
101 realdb:
102 runs-on: ubuntu-latest
103
104 services:
105 postgres:
106 image: postgres:latest
107 env:
108 POSTGRES_USER: postgres
109 POSTGRES_PASSWORD: testpw
110 POSTGRES_DB: testdb
111 ports:
112 - 5432:5432
113 options: >-
114 --health-cmd pg_isready
115 --health-interval 10s
116 --health-timeout 5s
117 --health-retries 5
118 steps:
119 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
120 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
121 with:
122 python-version: "3.13"
123 - name: update pip
124 run: |
125 python -m pip install -U pip
126 - name: cache pip
127 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
128 with:
129 path: ~/.cache/pip
130 key: pip-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }} }}
131 - name: Postgres
132 run: |
133 pip install tox
134 tox -e realpostgres -- --realdburl='postgresql://postgres:testpw@localhost:5432/testdb'