Skip to content

Conversation

@Sola-ris
Copy link
Contributor

Summary

As discussed on discord, run pytest on Windows and macOS.

I haven't added ripgrep to 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

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@Computerdores
Copy link
Collaborator

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

@Sola-ris
Copy link
Contributor Author

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.

@Computerdores
Copy link
Collaborator

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 ^^

@Sola-ris
Copy link
Contributor Author

Sola-ris commented Nov 13, 2025

Small indie company, pls understand^^

@CyanVoxel
Copy link
Member

CyanVoxel commented Nov 14, 2025

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 and not contribute towards the allotted action minutes

@CyanVoxel CyanVoxel added Type: CI Continuous Integration / workflows System: Windows For Microsoft Windows labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

System: Windows For Microsoft Windows Type: CI Continuous Integration / workflows

Projects

Status: 🍃 Pending Merge

Development

Successfully merging this pull request may close these issues.

3 participants