Skip to content

Commit 97709fb

Browse files
committed
ci(macOS): add macOS CI tests
1 parent 8be3724 commit 97709fb

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
# os: [ubuntu-latest, macos-latest, windows-latest]
33+
os: [ubuntu-latest, macos-latest]
3334
# python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
34-
os: [ubuntu-latest]
3535
python-version: ["3.9", "3.14", "3.14t"]
3636

3737
steps:
3838
- name: Harden the runner (Audit all outbound calls)
39+
if: matrix.os != 'windows-latest'
3940
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
4041
with:
4142
egress-policy: audit
@@ -50,12 +51,22 @@ jobs:
5051
python-version: ${{ matrix.python-version }}
5152
activate-environment: true
5253

53-
- name: Install system dependencies for GUI testing
54+
- name: Install system dependencies for GUI testing on linux
55+
if: matrix.os == 'ubuntu-latest'
5456
run: |
5557
sudo apt-get update
5658
sudo apt-get install -y python3-tk scrot xdotool x11-utils gnome-screenshot tcl8.6 tk8.6 libtcl8.6 libtk8.6
5759
60+
- name: Install system dependencies for GUI testing on macOS
61+
if: matrix.os == 'macos-latest'
62+
run: |
63+
# XQuartz is pre-installed on macOS runners for X11 support
64+
# Tkinter is available with Python installation
65+
# PyAutoGUI uses Quartz for screenshots and input on macOS
66+
# No additional system dependencies needed
67+
5868
- name: Ensure Tcl/Tk search paths
69+
if: matrix.os == 'ubuntu-latest'
5970
run: |
6071
echo "TCL_LIBRARY=/usr/share/tcltk/tcl8.6" >> $GITHUB_ENV
6172
echo "TK_LIBRARY=/usr/share/tcltk/tk8.6" >> $GITHUB_ENV
@@ -66,6 +77,7 @@ jobs:
6677
uv pip install --editable .[dev,ci_headless_tests]
6778
6879
- name: Download ArduCopter SITL (if available)
80+
if: matrix.os == 'ubuntu-latest'
6981
run: |
7082
# Create cache key based on current quarter (YYYY-Q)
7183
CURRENT_YEAR=$(date +%Y)
@@ -145,23 +157,23 @@ jobs:
145157
if: ${{ always() }}
146158

147159
- name: Upload coverage xml report
160+
# Use always() to always run this step to publish test results when there are test failures
161+
if: matrix.os == 'ubuntu-latest' && always()
148162
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
149163
with:
150164
name: coverage-${{ matrix.python-version }}-xml
151165
path: tests/*.xml
152166
retention-days: 1
153-
# Use always() to always run this step to publish test results when there are test failures
154-
if: ${{ always() }}
155167

156168
- name: Upload coverage report
169+
# Use always() to always run this step to publish test results when there are test failures
170+
if: matrix.os == 'ubuntu-latest' && always()
157171
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
158172
with:
159173
name: coverage-${{ matrix.python-version }}
160174
path: .coverage
161175
include-hidden-files: true
162176
retention-days: 1
163-
# Use always() to always run this step to publish test results when there are test failures
164-
if: ${{ always() }}
165177

166178
upload_coverage_to_coveralls:
167179
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') && (success() || failure())

0 commit comments

Comments
 (0)