Skip to content
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

ci: Enable tests on Windows OS #1177

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 32 additions & 46 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,49 +149,35 @@ jobs:
run: |
echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH
tox

# tests-windows:
# name: Unit Tests (Windows)
# runs-on: windows-latest
# if: github.event_name == 'pull_request'

# strategy:
# matrix:
# python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

# steps:
# - name: Checkout repository
# uses: actions/checkout@v4

# - name: Setup Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install Fonts
# shell: pwsh
# working-directory: .github/scripts
# run: |
# Invoke-WebRequest -Uri 'https://github.com/ietf-tools/common/raw/main/scripts/font-install/font-install.exe' -OutFile font-install.exe
# & ./font-install.exe -debug https://fonts.google.com/download?family=Roboto%20Mono
# & ./font-install.exe -debug https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip

# - name: Install dependencies
# shell: pwsh
# run: |
# Invoke-WebRequest -Uri 'https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/download/2022-01-04/gtk3-runtime-3.24.31-2022-01-04-ts-win64.exe' -OutFile gtk.exe
# & ./gtk.exe /S
# choco install make
# echo "Installing pip + wheel..."
# python -m pip install --upgrade pip wheel
# echo "Installing requirements.txt + test dependencies..."
# python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.1.0" "weasyprint==61.2" "pydyf<0.10.0"
# - name: Generate Valid Tests
# run: |
# make yestests || true
# cp tests/out/. tests/valid

# - name: Test with tox
# env:
# PLATFORM: windows-latest
# run: tox

tests-windows:
name: Unit Tests (Windows)
runs-on: windows-latest
if: github.event_name == 'pull_request'

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
shell: pwsh
run: |
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH
echo "Installing pip + wheel..."
python -m pip install --upgrade pip wheel
echo "Installing requirements.txt + test dependencies..."
python -m pip install -r requirements.txt tox tox-gh-actions certifi decorator dict2xml pyflakes "pypdf>=4.10"

- name: Run pytests
env:
PLATFORM: windows-latest
run: tox -- pytests
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import difflib
import lxml
import re
import sys
import unittest
import xml2rfc
import xml2rfc.utils
Expand Down Expand Up @@ -468,6 +469,7 @@ def test_status_independent_exp(self):
return self.status_test()


@unittest.skipIf(sys.platform.startswith("win"), "Test skipped on Windows OS")
class PdfWriterTests(unittest.TestCase):
elements_root = None
elements_pdfxml = None
Expand Down
Loading