Debian Codegraph @

.github/workflows/ci.yml

raw
1 name: CI
2
3 on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: [ master ]
8
9 concurrency:
10 group: ${{ github.workflow }}-${{ github.ref }}
11 cancel-in-progress: true
12
13 jobs:
14 build:
15 runs-on: ubuntu-latest
16 strategy:
17 fail-fast: false
18 matrix:
19 python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
20 django-version: ['4.2', '5.2', '6.0', '6.1']
21 exclude:
22 # Django 4.2: only py38, py39, py310, py312
23 - python-version: '3.11'
24 django-version: '4.2'
25 - python-version: '3.13'
26 django-version: '4.2'
27 - python-version: '3.14'
28 django-version: '4.2'
29 # Django 5.2: only py310, py311, py312, py313
30 - python-version: '3.8'
31 django-version: '5.2'
32 - python-version: '3.9'
33 django-version: '5.2'
34 - python-version: '3.14'
35 django-version: '5.2'
36 # Django 6.0: only py312, py313, py314
37 - python-version: '3.8'
38 django-version: '6.0'
39 - python-version: '3.9'
40 django-version: '6.0'
41 - python-version: '3.10'
42 django-version: '6.0'
43 - python-version: '3.11'
44 django-version: '6.0'
45 # Django 6.1: only py312, py313, py314
46 - python-version: '3.8'
47 django-version: '6.1'
48 - python-version: '3.9'
49 django-version: '6.1'
50 - python-version: '3.10'
51 django-version: '6.1'
52 - python-version: '3.11'
53 django-version: '6.1'
54 services:
55 redis:
56 image: redis:6
57 ports:
58 - 6379:6379
59 postgres:
60 image: postgres
61 ports:
62 - 5432:5432
63 env:
64 POSTGRES_USER: cachalot
65 POSTGRES_PASSWORD: password
66 POSTGRES_DB: cachalot
67 options: >-
68 --health-cmd pg_isready
69 --health-interval 10s
70 --health-timeout 5s
71 --health-retries 5
72 mysql:
73 image: mysql
74 env:
75 MYSQL_ALLOW_EMPTY_PASSWORD: yes
76 MYSQL_DATABASE: cachalot
77 ports:
78 - 3306:3306
79 memcached:
80 image: memcached
81 ports:
82 - 11211:11211
83
84 steps:
85 - uses: actions/checkout@v6
86 - name: Set up Python ${{ matrix.python-version }}
87 uses: actions/setup-python@v6
88 with:
89 python-version: ${{ matrix.python-version }}
90 - name: Get pip cache dir
91 id: pip-cache
92 run: |
93 echo "::set-output name=dir::$(pip cache dir)"
94 - name: Cache
95 uses: actions/cache@v4
96 with:
97 path: ${{ steps.pip-cache.outputs.dir }}
98 key:
99 ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
100 restore-keys: |
101 ${{ matrix.python-version }}-v1-
102 - name: Install dependencies
103 run: |
104 sudo apt-get install -y libmemcached-dev zlib1g-dev libpq-dev
105 python -m pip install --upgrade pip wheel
106 python -m pip install tox tox-gh-actions coveralls
107 - name: Tox Test
108 run: tox
109 env:
110 TOX_TESTENV_PASSENV: POSTGRES_PASSWORD
111 POSTGRES_PASSWORD: password
112 PYTHON_VER: ${{ matrix.python-version }}
113 DJANGO: ${{ matrix.django-version }}
114 - name: Coverage (Coveralls)
115 if: ${{ success() }}
116 run: coveralls --service=github
117 env:
118 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}