Debian Codegraph @

.github/workflows/tests.yml

raw
1 # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2
3 name: Tests
4
5 # env:
6 # ANSIBLE_VERBOSITY: 3
7 # MITOGEN_LOG_LEVEL: DEBUG
8
9 on:
10 pull_request:
11 push:
12 branches-ignore:
13 - docs-master
14
15 # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
16 # https://github.com/actions/runner-images/blob/main/README.md#software-and-image-support
17 jobs:
18 u2204:
19 name: u2204 ${{ matrix.tox_env }}
20 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
21 runs-on: ubuntu-22.04
22 timeout-minutes: 25
23
24 strategy:
25 fail-fast: false
26 matrix:
27 include:
28 - tox_env: py27-m_ans-ans2.10
29 - tox_env: py27-m_ans-ans4
30
31 - tox_env: py36-m_ans-ans2.10
32 - tox_env: py36-m_ans-ans4
33
34 - tox_env: py27-m_mtg
35 - tox_env: py36-m_mtg
36
37 steps:
38 - uses: actions/checkout@v6
39 - uses: docker/login-action@v4
40 with:
41 registry: ghcr.io
42 username: ${{ github.actor }}
43 password: ${{ secrets.GITHUB_TOKEN }}
44 - run: .ci/show_python_versions
45 - run: .ci/setup_ssh_key_mitogen__has_sudo_pubkey
46 - run: .ci/setup_sudoers_defaults
47 if: ${{ contains(matrix.tox_env, 'm_mtg') }}
48 - name: Install deps
49 id: install-deps
50 run: |
51 set -o errexit -o nounset -o pipefail
52 source .ci/bash_functions
53 PYTHON="$(toxenv-python '${{ matrix.tox_env }}')"
54
55 sudo apt-get update
56
57 if [[ $PYTHON == "python2.7" ]]; then
58 sudo apt install -y python2-dev sshpass virtualenv
59 curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
60 "$PYTHON" get-pip.py --user --no-python-version-warning
61 # Avoid Python 2.x pip masking system pip
62 rm -f ~/.local/bin/{easy_install,pip,wheel}
63 elif [[ $PYTHON == "python3.6" ]]; then
64 sudo apt install -y gcc-10 make libbz2-dev liblzma-dev libreadline-dev libsqlite3-dev libssl-dev sshpass virtualenv zlib1g-dev
65 curl --fail --silent --show-error --location https://pyenv.run | bash
66 CC=gcc-10 ~/.pyenv/bin/pyenv install --force 3.6
67 PYTHON="$HOME/.pyenv/versions/3.6.15/bin/python3.6"
68 fi
69
70 "$PYTHON" -m pip install -r "tests/requirements-tox.txt"
71 echo "python=$PYTHON" >> $GITHUB_OUTPUT
72 - name: Create environments
73 run: |
74 set -o errexit -o nounset -o pipefail
75 PYTHON="${{ steps.install-deps.outputs.python }}"
76 "$PYTHON" -m tox --notest -e "${{ matrix.tox_env }}"
77 - name: Run tests
78 env:
79 GITHUB_ACTOR: ${{ github.actor }}
80 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81 run: |
82 set -o errexit -o nounset -o pipefail
83 PYTHON="${{ steps.install-deps.outputs.python }}"
84
85 "$PYTHON" -m tox -e "${{ matrix.tox_env }}"
86
87 u2404:
88 name: u2404 ${{ matrix.tox_env }}
89 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
90 runs-on: ubuntu-24.04
91 timeout-minutes: 25
92
93 strategy:
94 fail-fast: false
95 matrix:
96 include:
97 - tox_env: py311-m_ans-ans2.10
98 python_version: '3.11'
99 - tox_env: py311-m_ans-ans3
100 python_version: '3.11'
101 - tox_env: py311-m_ans-ans4
102 python_version: '3.11'
103 - tox_env: py311-m_ans-ans5
104 python_version: '3.11'
105 - tox_env: py313-m_ans-ans6
106 python_version: '3.13'
107 - tox_env: py313-m_ans-ans7
108 python_version: '3.13'
109 - tox_env: py313-m_ans-ans8
110 python_version: '3.13'
111 - tox_env: py314-m_ans-ans9
112 python_version: '3.14'
113 - tox_env: py314-m_ans-ans10
114 python_version: '3.14'
115 - tox_env: py314-m_ans-ans11
116 python_version: '3.14'
117 - tox_env: py314-m_ans-ans12
118 python_version: '3.14'
119 - tox_env: py314-m_ans-ans13
120 python_version: '3.14'
121 - tox_env: py314-m_ans-ans14
122 python_version: '3.14'
123
124 - tox_env: py314-m_ans-ans14-s_lin
125 python_version: '3.14'
126
127 - tox_env: py314-m_mtg
128 python_version: '3.14'
129
130 steps:
131 - uses: actions/checkout@v6
132 - uses: actions/setup-python@v6
133 with:
134 python-version: ${{ matrix.python_version }}
135 if: ${{ matrix.python_version }}
136 - uses: docker/login-action@v4
137 with:
138 registry: ghcr.io
139 username: ${{ github.actor }}
140 password: ${{ secrets.GITHUB_TOKEN }}
141 - run: .ci/show_python_versions
142 - run: .ci/setup_ssh_key_mitogen__has_sudo_pubkey
143 - run: .ci/setup_sudoers_defaults
144 if: ${{ contains(matrix.tox_env, 'm_mtg') }}
145 - name: Install deps
146 id: install-deps
147 run: |
148 set -o errexit -o nounset -o pipefail
149 source .ci/bash_functions
150 PYTHON="$(toxenv-python '${{ matrix.tox_env }}')"
151
152 sudo apt-get update
153 sudo apt-get install -y sshpass virtualenv
154
155 "$PYTHON" -m pip install -r "tests/requirements-tox.txt"
156 echo "python=$PYTHON" >> $GITHUB_OUTPUT
157 - name: Create environments
158 run: |
159 set -o errexit -o nounset -o pipefail
160 PYTHON="${{ steps.install-deps.outputs.python }}"
161 "$PYTHON" -m tox --notest -e "${{ matrix.tox_env }}"
162 - name: Run tests
163 env:
164 GITHUB_ACTOR: ${{ github.actor }}
165 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166 run: |
167 set -o errexit -o nounset -o pipefail
168 PYTHON="${{ steps.install-deps.outputs.python }}"
169
170 "$PYTHON" -m tox -e "${{ matrix.tox_env }}"
171
172 macos:
173 name: macos ${{ matrix.tox_env }}
174 # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
175 runs-on: macos-15
176 timeout-minutes: 20
177 env:
178 MITOGEN_TEST_SKIP_CONTAINER_TESTS: 1
179
180 strategy:
181 fail-fast: false
182 matrix:
183 include:
184 - tox_env: py314-m_lcl-ans14
185 python_version: '3.14'
186 - tox_env: py314-m_lcl-ans14-s_lin
187 python_version: '3.14'
188
189 - tox_env: py314-m_mtg
190 python_version: '3.14'
191
192 steps:
193 - uses: actions/checkout@v6
194 - uses: actions/setup-python@v6
195 with:
196 python-version: ${{ matrix.python_version }}
197 if: ${{ matrix.python_version }}
198 - run: .ci/show_python_versions
199 - run: .ci/install_sshpass ${{ matrix.sshpass_version }}
200 if: ${{ matrix.sshpass_version }}
201 - run: .ci/setup_ssh_key_localhost
202 if: ${{ contains(matrix.tox_env, 'm_lcl') }}
203 - run: .ci/setup_ssh_key_mitogen__has_sudo_pubkey
204 - run: .ci/setup_sudoers_defaults
205 if: ${{ contains(matrix.tox_env, 'm_mtg') }}
206 - name: Install deps
207 id: install-deps
208 run: |
209 set -o errexit -o nounset -o pipefail
210 source .ci/bash_functions
211 PYTHON="$(toxenv-python '${{ matrix.tox_env }}')"
212
213 "$PYTHON" -m pip install -r "tests/requirements-tox.txt"
214 echo "python=$PYTHON" >> $GITHUB_OUTPUT
215 - name: Create environments
216 run: |
217 set -o errexit -o nounset -o pipefail
218 PYTHON="${{ steps.install-deps.outputs.python }}"
219 "$PYTHON" -m tox --notest -e "${{ matrix.tox_env }}"
220 - name: Run tests
221 env:
222 GITHUB_ACTOR: ${{ github.actor }}
223 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224 run: |
225 set -o errexit -o nounset -o pipefail
226 PYTHON="${{ steps.install-deps.outputs.python }}"
227
228 "$PYTHON" -m tox -e "${{ matrix.tox_env }}"
229
230 # https://github.com/marketplace/actions/alls-green
231 check:
232 if: always()
233 needs:
234 - u2204
235 - u2404
236 - macos
237 runs-on: ubuntu-latest
238 steps:
239 - uses: re-actors/alls-green@release/v1
240 with:
241 jobs: ${{ toJSON(needs) }}