Skip to content

Commit be011eb

Browse files
authored
Merge pull request #1959 from dbcli/RW/publish-test-on-all-platforms
Test on all platforms when publishing
2 parents f5a7733 + 82dbd35 commit be011eb

2 files changed

Lines changed: 163 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 162 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
if grep -q TBD changelog.md; then false; fi
2020
21-
test:
21+
tests:
2222
runs-on: ubuntu-latest
2323
needs: [docs]
2424
continue-on-error: true
@@ -62,9 +62,167 @@ jobs:
6262
- name: Run Style Checks
6363
run: uv run tox -e style
6464

65+
tests-macos:
66+
name: Tests macOS
67+
runs-on: macos-latest
68+
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
python-version: ["3.14"]
73+
74+
steps:
75+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
76+
77+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
78+
with:
79+
version: "latest"
80+
81+
- name: Set up Python ${{ matrix.python-version }}
82+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
83+
with:
84+
python-version: ${{ matrix.python-version }}
85+
86+
- name: Set up MySQL
87+
run: |
88+
brew install mysql
89+
90+
- name: Start MySQL
91+
run: |
92+
brew services start mysql
93+
94+
- name: Install dependencies
95+
run: uv sync --all-extras -p ${{ matrix.python-version }}
96+
97+
- name: Wait for MySQL connection
98+
run: |
99+
while ! mysqladmin ping --host=localhost --port=3306 --user=root --silent; do
100+
sleep 5
101+
done
102+
103+
- name: Set MySQL test credentials
104+
run: |
105+
$(brew --prefix mysql)/bin/mysqladmin --host=localhost --port=3306 --user=root password root
106+
107+
- name: Pytest / behave
108+
env:
109+
PYTEST_PASSWORD: root
110+
PYTEST_HOST: 127.0.0.1
111+
TERM: xterm
112+
run: |
113+
uv run tox -e py${{ matrix.python-version }}
114+
115+
tests-windows:
116+
name: Tests Windows
117+
runs-on: windows-latest
118+
119+
strategy:
120+
fail-fast: false
121+
matrix:
122+
python-version: ['3.14']
123+
124+
steps:
125+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
126+
127+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
128+
with:
129+
version: 'latest'
130+
131+
- name: Set up Python ${{ matrix.python-version }}
132+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
133+
with:
134+
python-version: ${{ matrix.python-version }}
135+
136+
- name: Install dependencies
137+
shell: cmd
138+
run: uv sync --all-extras -p ${{ matrix.python-version }}
139+
140+
- name: Set up MySQL
141+
uses: shogo82148/actions-setup-mysql@076e636c45996ec8cb1a455c65f9f5364aeebd8a # v1.52.1
142+
with:
143+
mysql-version: '9.7'
144+
root-password: root
145+
146+
- name: Run pytest
147+
env:
148+
PYTEST_PASSWORD: root
149+
PYTEST_HOST: 127.0.0.1
150+
run: |
151+
uv run -- coverage run -m pytest
152+
uv run -- coverage report -m --sort=Miss --skip-covered --skip-empty
153+
154+
tests-wsl:
155+
name: Tests WSL
156+
runs-on: windows-latest
157+
158+
steps:
159+
- uses: vampire/setup-wsl@d1da7f2c0322a5ee4f24975344f67fc0f5baf364 # v7.0.0
160+
with:
161+
distribution: Ubuntu-24.04
162+
update: 'true'
163+
additional-packages: |
164+
curl
165+
git
166+
mysql-server
167+
pkg-config
168+
build-essential
169+
python3-pip
170+
171+
- name: Create working directory
172+
shell: wsl-bash {0}
173+
run: |
174+
mkdir -p /root/mycli
175+
176+
- uses: ubuntu/wsl/.github/actions/wsl-checkout@42e1abc303b6d2eaf61b8a2050ccc8a9e23ac20b
177+
with:
178+
distro: Ubuntu-24.04
179+
working-dir: /root/mycli
180+
181+
- name: Install uv
182+
shell: wsl-bash {0}
183+
run: |
184+
export PATH="$HOME/.local/bin:$PATH"
185+
env PYTHONPATH=/usr/local/lib/python3.14/site-packages pip install --upgrade --break-system-packages --prefix=/usr uv
186+
187+
- name: Install dependencies
188+
shell: wsl-bash {0}
189+
run: |
190+
export PATH="$HOME/.local/bin:$PATH"
191+
cd /root/mycli
192+
uv sync --all-extras --python 3.14
193+
194+
- name: Start MySQL in WSL
195+
shell: wsl-bash {0}
196+
run: |
197+
sudo service mysql start
198+
199+
- name: Wait for MySQL connection
200+
shell: wsl-bash {0}
201+
run: |
202+
while ! mysqladmin ping --host=localhost --port=3306 --user=root --silent; do
203+
sleep 5
204+
done
205+
206+
- name: Set up MySQL
207+
shell: wsl-bash {0}
208+
run: |
209+
mysqladmin -u root password root
210+
211+
- name: Run pytest
212+
shell: wsl-bash {0}
213+
env:
214+
PYTEST_HOST: 127.0.0.1
215+
PYTEST_USER: root
216+
PYTEST_PASSWORD: root
217+
run: |
218+
export PATH="$HOME/.local/bin:$PATH"
219+
cd /root/mycli
220+
uv run --python 3.14 -- coverage run -m pytest
221+
uv run --python 3.14 -- coverage report -m --sort=Miss --skip-covered --skip-empty
222+
65223
build:
66224
runs-on: ubuntu-latest
67-
needs: [test]
225+
needs: [tests, tests-macos, tests-windows, tests-wsl]
68226

69227
steps:
70228
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -75,10 +233,10 @@ jobs:
75233
- name: Set up Python
76234
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
77235
with:
78-
python-version: '3.13'
236+
python-version: '3.14'
79237

80238
- name: Install dependencies
81-
run: uv sync --all-extras -p 3.13
239+
run: uv sync --all-extras -p 3.14
82240

83241
- name: Build
84242
run: uv build

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Documentation
2020
Internal
2121
---------
2222
* Improve test coverage for DSN variable expansion.
23+
* Test on all platforms in the Publish GitHub Action.
2324

2425

2526
1.76.0 (2026/06/20)

0 commit comments

Comments
 (0)