This directory contains the GitHub Actions workflows for continuous integration and testing.
This workflow runs the test suite on all three supported platforms:
- Ubuntu Latest (Linux)
- macOS Latest
- Windows Latest
- Multi-Platform Matrix: Tests run in parallel on all three platforms
- Python 3.13: Uses the required Python version
- System Dependencies: Automatically installs platform-specific dependencies
- Linux:
python3-tkandxvfbfor headless GUI testing - macOS: tkinter included with Python
- Windows: tkinter included with Python
- Linux:
- Headless GUI Testing: Uses
xvfbon Linux to run GUI tests without a display - Code Quality: Runs linting (ruff) and type checking (mypy)
- Coverage Reports: Generates coverage reports and uploads to Codecov
- Test Artifacts: Archives test results for 30 days
The workflow runs on:
- Push to
mainordevelopbranches - Pull requests to
mainordevelopbranches - Manual trigger via
workflow_dispatch
Linux (with xvfb for GUI tests):
xvfb-run -a pytest --verbose --cov=src/email_signature --cov-report=term-missing --cov-report=xmlmacOS and Windows:
pytest --verbose --cov=src/email_signature --cov-report=term-missing --cov-report=xmlpytest# Run only Windows-specific tests
pytest -m windows
# Run only macOS-specific tests
pytest -m macos
# Run only Linux-specific tests
pytest -m linux# Run all GUI tests
pytest -m gui
# Skip GUI tests
pytest -m "not gui"# Install xvfb
sudo apt-get install xvfb
# Run tests with xvfb
xvfb-run -a pytestThe following pytest markers are available:
@pytest.mark.windows: Windows-specific tests@pytest.mark.macos: macOS-specific tests@pytest.mark.linux: Linux-specific tests@pytest.mark.gui: Tests that require GUI/display@pytest.mark.slow: Slow-running tests@pytest.mark.integration: Integration tests
import pytest
@pytest.mark.windows
@pytest.mark.skipif(platform.system() != "Windows", reason="Windows-specific test")
def test_windows_feature():
# Test Windows-specific functionality
pass
@pytest.mark.gui
def test_gui_feature():
# Test GUI functionality
passTests automatically skip on incompatible platforms using pytest.mark.skipif:
@pytest.mark.windows
@pytest.mark.skipif(platform.system() != "Windows", reason="Windows-specific test")
def test_image_generation_on_windows():
# This test only runs on Windows
passIf GUI tests fail on Linux, ensure xvfb is installed and running:
sudo apt-get install xvfb
xvfb-run -a pytest -m guiCheck the GitHub Actions logs for the specific platform to see detailed error messages.
Ensure the CODECOV_TOKEN secret is set in the repository settings (if using private repository).
When adding new tests:
-
Platform-Specific Tests: Add appropriate markers
@pytest.mark.windows def test_windows_feature(): pass
-
GUI Tests: Add the
@pytest.mark.guimarker@pytest.mark.gui def test_gui_feature(): pass
-
Cross-Platform Tests: No marker needed, they run on all platforms
-
Update Documentation: Update this README if adding new markers or workflows