-
-
Notifications
You must be signed in to change notification settings - Fork 422
feat: run tests on windows and macOS. #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
consider using anchors to deduplicate the python setup steps, for example this should work I believe: anchors:
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 |
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