diff --git a/.github/workflows/cross-platform-qa.yml b/.github/workflows/cross-platform-qa.yml new file mode 100644 index 0000000..09c72fb --- /dev/null +++ b/.github/workflows/cross-platform-qa.yml @@ -0,0 +1,56 @@ +name: Cross-platform desktop QA + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + portable-tests: + name: Python ${{ matrix.os }} / ${{ matrix.python }} + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + python: "3.12" + - os: windows-latest + python: "3.13" + - os: macos-latest + python: "3.12" + - os: macos-latest + python: "3.13" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: pip + cache-dependency-path: requirements.txt + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: Compile sources + run: python -m compileall -q app tests + - name: Run platform regression suite + run: python -m pytest -q + - name: Launch Tkinter desktop window (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + @' + import tkinter as tk + from app.gui import ShiftPlannerApp + root = tk.Tk() + root.withdraw() + app = ShiftPlannerApp(root) + root.update_idletasks() + assert root.title() == "Vagtplanlægning" + root.destroy() + print("Tkinter window initialised successfully") + '@ | python -