feat: add windows runner for pytest #1201
Conversation
|
consider using anchors to deduplicate the python setup steps, for example this should work I believe: Detailsanchors:
base_setup:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install Python dependencies
run: |
python -m pip install --upgrade uv
uv pip install --system .[pytest]
jobs:
pytest-linux:
name: Run pytest (Linux)
runs-on: ubuntu-24.04
steps:
<<: *base_setup
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libegl1 \
libgl1 \
libopengl0 \
libpulse0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxkbcommon-x11-0 \
libyaml-dev \
x11-utils
- name: Execute pytest
run: |
xvfb-run pytest --cov-report xml --cov=tagstudio
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
pytest-windows:
name: Run pytest (Windows)
runs-on: windows-2025
steps:
<<: *base_setup
- name: Install system dependencies
run: |
brew install ripgrep
- name: Execute pytest
run: |
pytest
pytest-macos:
name: Run pytest (macOS)
runs-on: macos-15
steps:
<<: *base_setup
- name: Install system dependencies
run: |
brew install ripgrep
- name: Execute pytest
run: |
pytest |
|
I wasn't aware GitHub supported anchors, thank you. The merge keys you mentioned are unfortunately not supported (actions/runner#1182 (comment)) but we can reuse the individual steps via anchors. |
lol gitlab does, but hey it's not like Github is operated by a massive company like microsoft or something ^^ |
|
Small indie company, pls understand^^ |
|
Thank you for this! I feel that having a macOS runner isn't entirely necessary due to the test behavior being nearly identical to the Linux runner across the history of the project. Windows tests on the other hand have had numerous differences over time due the the fundamentally different OS architecture and having a runner for that will would help catch those issues. Omitting the macOS runner would also save on time |
I've removed the macOS job. |
CyanVoxel
left a comment
There was a problem hiding this comment.
Thank you for your work on this!
* feat: run tests on windows and macOS. * resue steps via anchors. * remove macOS job.
Summary
As discussed on discord, run pytest on Windows and macOS.
I haven't added
ripgrepto the list of installed Linux packages, since that will be handled by #1199.I've omitted the coverage check from the new jobs since the result is the same across all jobs.
Tasks Completed