diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 0b6f9d28..efc5bce8 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -14,37 +14,42 @@ jobs: testLinux: strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" fail-fast: false runs-on: ubuntu-latest steps: - - name: Python Setup - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - - name: Install Packages (apt) + - name: Install System Packages run: | sudo apt update sudo apt install qttools5-dev-tools + - name: Install UV and Python + uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Checkout Source uses: actions/checkout@v5 - - name: Install UV - uses: astral-sh/setup-uv@v6 + - name: Sync UV + run: | + uv sync --no-dev --group test - name: Run Build Commands run: | - uv run --no-dev pkgutils.py qtlrelease - uv run --no-dev pkgutils.py sample + uv run --no-sync pkgutils.py qtlrelease + uv run --no-sync pkgutils.py sample - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - uv run --no-dev --group test coverage run -m pytest -v --timeout=60 - uv run --no-dev --group test coverage xml + uv run --no-sync coverage run -m pytest -v --timeout=60 + uv run --no-sync coverage xml - name: Upload to Codecov uses: codecov/codecov-action@v5 diff --git a/.github/workflows/test_mac.yml b/.github/workflows/test_mac.yml index 7ecb5116..21a5e6e6 100644 --- a/.github/workflows/test_mac.yml +++ b/.github/workflows/test_mac.yml @@ -14,24 +14,36 @@ jobs: testMac: runs-on: macos-latest steps: - - name: Python Setup - uses: actions/setup-python@v6 + # - name: Python Setup + # uses: actions/setup-python@v6 + # with: + # python-version: "3.13" + # architecture: x64 + + # - name: Install Packages (brew) + # run: | + # brew install enchant + + - name: Install UV and Python + uses: astral-sh/setup-uv@v6 with: python-version: "3.13" - architecture: x64 - - name: Install Packages (brew) - run: | - brew install enchant + - name: Checkout Source uses: actions/checkout@v5 - - name: Install Dependencies (pip) + + - name: Sync UV run: | - pip install -U pyobjc -r requirements.txt -r tests/requirements.txt + uv sync --no-dev --group test --group macos + - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - python -m pytest -v --cov=novelwriter --timeout=60 + uv run --no-sync coverage run -m pytest -v --timeout=60 + uv run --no-sync coverage xml + - name: Upload to Codecov uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/pyproject.toml b/pyproject.toml index d0e66ec4..945e8028 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,7 @@ docs = [ ] test = ["coverage>=7.2.0", "pytest-qt", "pytest-timeout", "pytest>=6.0.0"] lint = ["isort", "pyright", "ruff"] +macos = ["pyobjc"] [project.urls] Homepage = "https://novelwriter.io"