-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.81 KB
/
Copy pathauto-tests-win.yml
File metadata and controls
75 lines (65 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
name: Auto Run Tests For Windows with all push
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
# 1) WINDOWS JOB (Runs only Windows-safe tests from GitHub Win Runner)
windows-tests:
name: Windows Tests (Algorithms + DB + Export)
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
# Install dependencies txt files
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install language-tool-python==2.9.5
# Prevent pygame/tkinter to open a window & GUI mocks to run in CI
- name: Configure headless SDL / GUI
run: |
echo "SDL_VIDEODRIVER=dummy" >> $GITHUB_ENV
echo "SDL_AUDIODRIVER=dummy" >> $GITHUB_ENV
echo "PYGAME_HIDE_SUPPORT_PROMPT=1" >> $GITHUB_ENV
# Run ONLY Windows tests as gitHub dislikes test_gui, test_system, test_integrations, test_translation, etc.
- name: Run all pytests suite
run: |
$env:SDL_VIDEODRIVER="dummy"
$env:SDL_AUDIODRIVER="dummy"
python -m pytest -vv --maxfail=1 --disable-warnings tests/test_algorithms.py tests/test_database.py tests/test_email.py tests/test_export_json.py tests/test_export_pdf.py tests/test_validation.py tests/test_spelling.py
# 2) UBUNTU JOB (Runs ALL tests with missing: test_gui, test_system, test_integration, test_settings, test_translation anything gui/tk/vm tk)
ubuntu-tests:
name: Ubuntu Full Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-tk python3-dev pulseaudio xvfb
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
python -m pip install sphinx numpy>=1.21.0 "Cython>=3.0,<3.1"
- name: Run all pytests suite with Xvfb (auto-detect video driver) and PulseAudio in tests
run: |
export SDL_AUDIODRIVER=disk # Use disk-based audio driver
export PULSE_SERVER=unix:/run/user/1000/pulse/native # Optional, in case PulseAudio is needed
xvfb-run --auto-servernum python -m pytest tests/ -vv --maxfail=1 --disable-warnings