Debian Codegraph @

.github/workflows/testing.yml

raw
1 name: Kazoo Awesome Testing
2
3 on:
4 push:
5 branches:
6 - master
7 - release/*
8 pull_request:
9 branches:
10 - master
11 - release/*
12
13 jobs:
14 validate:
15 name: Code Validation
16
17 runs-on: ubuntu-latest
18
19 steps:
20 - uses: actions/checkout@v4
21
22 - uses: actions/setup-python@v5
23 with:
24 python-version: "3.12"
25
26 - name: Handle pip cache
27 uses: actions/cache@v4
28 with:
29 path: ~/.cache/pip
30 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
31 restore-keys: |
32 ${{ runner.os }}-pip-
33
34 - name: Install required dependencies
35 run: |
36 python3 -m pip install --upgrade pip
37 pip install tox
38
39 - name: Code check
40 run: tox -e ${TOX_VENV}
41 env:
42 TOX_VENV: black,pep8,mypy
43
44 test:
45 needs: [validate]
46
47 name: >
48 Linux - Test Python ${{ matrix.python-version }},
49 ZK ${{ matrix.zk-version }}
50 runs-on: ubuntu-latest
51
52 strategy:
53 fail-fast: false
54 matrix:
55 python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.10-v7.3.15"]
56 zk-version: ["3.6.4", "3.7.2", "3.8.3", "3.9.1"]
57 include:
58 - python-version: "3.8"
59 tox-env: py38
60 - python-version: "3.9"
61 tox-env: py39
62 - python-version: "3.10"
63 tox-env: py310
64 - python-version: "3.11"
65 tox-env: py311
66 - python-version: "3.12"
67 tox-env: py312
68 - python-version: "3.13"
69 tox-env: py313
70 - python-version: "3.14"
71 tox-env: py314
72 - python-version: "pypy-3.10-v7.3.15"
73 tox-env: pypy3
74 steps:
75 - uses: actions/checkout@v4
76
77 - name: Set up Python ${{ matrix.python-version }}
78 uses: actions/setup-python@v5
79 with:
80 python-version: ${{ matrix.python-version }}
81
82 - name: Handle pip cache
83 uses: actions/cache@v4
84 with:
85 path: ~/.cache/pip
86 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
87 restore-keys: |
88 ${{ runner.os }}-pip-
89
90 - name: Handle ZK installation cache
91 uses: actions/cache@v4
92 with:
93 path: zookeeper
94 key: ${{ runner.os }}-zookeeper
95 restore-keys: |
96 ${{ runner.os }}-zookeeper
97
98 - name: Install required dependencies
99 run: |
100 sudo apt-get -y install libevent-dev krb5-kdc krb5-admin-server libkrb5-dev
101 python3 -m pip install --upgrade pip
102 pip install tox
103
104 - name: Test with tox
105 run: tox -e ${TOX_VENV}
106 env:
107 TOX_VENV: ${{ format('{0}-{1}', matrix.tox-env, 'gevent-eventlet-sasl') }}
108 ZOOKEEPER_VERSION: ${{ matrix.zk-version }}
109 # TODO: can be removed once tests for ZK 3.4 are removed
110 ZOOKEEPER_PREFIX: "${{ !contains(matrix.zk-version, '3.4') && 'apache-' || '' }}"
111 ZOOKEEPER_SUFFIX: "${{ !contains(matrix.zk-version, '3.4') && '-bin' || '' }}"
112 ZOOKEEPER_LIB: "${{ !contains(matrix.zk-version, '3.4') && 'lib' || '' }}"
113
114 - name: Publish Codecov report
115 uses: codecov/codecov-action@v4
116
117 test_windows:
118 needs: [validate]
119 name: Windows - Sanity test using a single version of Python and ZK
120
121 runs-on: windows-latest
122 steps:
123 - uses: actions/checkout@v4
124
125 - uses: actions/setup-python@v5
126 with:
127 python-version: "3.12"
128
129 - name: Handle pip cache
130 uses: actions/cache@v4
131 with:
132 path: ~/.cache/pip
133 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
134 restore-keys: |
135 ${{ runner.os }}-pip-
136
137 - name: Handle ZK installation cache
138 uses: actions/cache@v4
139 with:
140 path: zookeeper
141 key: ${{ runner.os }}-zookeeper
142 restore-keys: |
143 ${{ runner.os }}-zookeeper
144
145 # https://github.com/actions/setup-java
146 - name: Setup Java
147 uses: actions/setup-java@v4
148 with:
149 distribution: 'temurin'
150 java-version: '17'
151
152 - name: Install required dependencies
153 run: |
154 python3 -m pip install --upgrade pip
155 pip install tox
156
157 - name: Test with tox
158 run: tox -e py310
159 env:
160 ZOOKEEPER_VERSION: 3.9.1
161 ZOOKEEPER_PREFIX: "apache-"
162 ZOOKEEPER_SUFFIX: "-bin"
163 ZOOKEEPER_LIB: "lib"
164 shell: bash