Skip to content

Commit 9b0368e

Browse files
committed
ci(pytest): Be OS-explicit in the pytest regression tests
This makes it easier to add support for MS-Windows and macOS
1 parent e72707f commit 9b0368e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

.github/workflows/pytest.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ jobs:
2828
runs-on: ${{ matrix.os }}
2929
strategy:
3030
fail-fast: false
31-
matrix:
32-
# os: [ubuntu-latest, macos-latest, windows-latest]
33-
# python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
34-
os: [ubuntu-latest]
35-
python-version: ["3.9", "3.14", "3.14t"]
31+
include:
32+
- os: ubuntu-latest
33+
python-version: "3.9" # to make sure the minimum AMC supported python version does not break
34+
- os: ubuntu-latest
35+
python-version: "3.14" # to make sure the latest AMC supported python version does not break
3636

3737
steps:
3838
- name: Harden the runner (Audit all outbound calls)
39+
if: matrix.os != 'windows-latest'
3940
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
4041
with:
4142
egress-policy: audit
@@ -50,7 +51,8 @@ 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
# Only install system Tcl/Tk for Python < 3.13 (newer versions bundle their own)
@@ -65,6 +67,7 @@ jobs:
6567
python3 --version && python3 -c "import tkinter; print(tkinter.TclVersion, tkinter.TkVersion)"
6668
6769
- name: Ensure Tcl/Tk search paths
70+
if: matrix.os == 'ubuntu-latest'
6871
run: |
6972
# Only set Tcl/Tk paths for Python < 3.13
7073
if [[ "${{ matrix.python-version }}" < "3.13" ]]; then
@@ -81,6 +84,7 @@ jobs:
8184
uv pip install --editable .[dev,ci_headless_tests]
8285
8386
- name: Download ArduCopter SITL (if available)
87+
if: matrix.os == 'ubuntu-latest'
8488
run: |
8589
# Create cache key based on current quarter (YYYY-Q)
8690
CURRENT_YEAR=$(date +%Y)
@@ -160,23 +164,23 @@ jobs:
160164
if: ${{ always() }}
161165

162166
- name: Upload coverage xml report
167+
# Use always() to always run this step to publish test results when there are test failures
168+
if: matrix.os == 'ubuntu-latest' && always()
163169
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
164170
with:
165171
name: coverage-${{ matrix.python-version }}-xml
166172
path: tests/*.xml
167173
retention-days: 1
168-
# Use always() to always run this step to publish test results when there are test failures
169-
if: ${{ always() }}
170174

171175
- name: Upload coverage report
176+
# Use always() to always run this step to publish test results when there are test failures
177+
if: matrix.os == 'ubuntu-latest' && always()
172178
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
173179
with:
174180
name: coverage-${{ matrix.python-version }}
175181
path: .coverage
176182
include-hidden-files: true
177183
retention-days: 1
178-
# Use always() to always run this step to publish test results when there are test failures
179-
if: ${{ always() }}
180184

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

0 commit comments

Comments
 (0)