Skip to content

Commit 5676dbb

Browse files
Merge pull request #4 from VictoriaRaven/updates
Updates on py files test files readme file and github actions and testing
2 parents 1afb602 + 82d19cc commit 5676dbb

22 files changed

Lines changed: 937 additions & 270 deletions
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Auto Run Tests For Mac with all push
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- '*'
11+
workflow_dispatch:
12+
jobs:
13+
test:
14+
runs-on: macos-latest
15+
16+
steps:
17+
# Step 1: Checkout the repository codes
18+
- name: Checkout Repository
19+
uses: actions/checkout@v3
20+
21+
# Step 2: Install SDL2 (for pygame)
22+
- name: Install SDL2 (for pygame)
23+
run: |
24+
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
25+
26+
# Step 3: Set up Python environment
27+
- name: Set up Python
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: '3.x'
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
pip install -r requirements-dev.txt
37+
38+
- name: Run all pytests suite
39+
run: |
40+
python -m pytest tests/ -vv --maxfail=1 --disable-warnings
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Auto Run Tests For Ubuntu with all push
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- '*'
11+
workflow_dispatch:
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update --fix-missing
27+
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
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
pip install -r requirements-dev.txt
31+
python -m pip install sphinx numpy>=1.21.0 "Cython>=3.0,<3.1"
32+
33+
- name: Run all pytests suite with Xvfb (auto-detect video driver) and PulseAudio in tests
34+
run: |
35+
export SDL_AUDIODRIVER=disk # Use disk-based audio driver
36+
export PULSE_SERVER=unix:/run/user/1000/pulse/native # Optional, in case PulseAudio is needed
37+
xvfb-run --auto-servernum python -m pytest tests/ -vv --maxfail=1 --disable-warnings
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: Auto Run Tests For Windows with all push
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- '*'
11+
workflow_dispatch:
12+
jobs:
13+
# 1) WINDOWS JOB (Runs only Windows-safe tests from GitHub Win Runner)
14+
windows-tests:
15+
name: Windows Tests (Algorithms + DB + Export)
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.x'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
pip install -r requirements-dev.txt
32+
33+
# Prevent pygame/tkinter to open a window & GUI mocks to run in CI
34+
- name: Configure headless SDL / GUI
35+
run: |
36+
echo "SDL_VIDEODRIVER=dummy" >> $GITHUB_ENV
37+
echo "SDL_AUDIODRIVER=dummy" >> $GITHUB_ENV
38+
echo "PYGAME_HIDE_SUPPORT_PROMPT=1" >> $GITHUB_ENV
39+
40+
# Run ONLY Windows tests as gitHub dislikes test_gui, test_system, test_integrations, test_translation, etc.
41+
- name: Run all pytests suite
42+
run: |
43+
$env:SDL_VIDEODRIVER="dummy"
44+
$env:SDL_AUDIODRIVER="dummy"
45+
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
46+
47+
# 2) UBUNTU JOB (Runs ALL tests with missing: test_gui, test_system, test_integration, test_settings, test_translation anything gui/tk/vm tk)
48+
ubuntu-tests:
49+
name: Ubuntu Full Test Suite
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout Repository
53+
uses: actions/checkout@v3
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v3
57+
with:
58+
python-version: '3.x'
59+
60+
- name: Install dependencies
61+
run: |
62+
sudo apt-get update --fix-missing
63+
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
64+
python -m pip install --upgrade pip
65+
pip install -r requirements.txt
66+
pip install -r requirements-dev.txt
67+
python -m pip install sphinx numpy>=1.21.0 "Cython>=3.0,<3.1"
68+
69+
- name: Run all pytests suite with Xvfb (auto-detect video driver) and PulseAudio in tests
70+
run: |
71+
export SDL_AUDIODRIVER=disk # Use disk-based audio driver
72+
export PULSE_SERVER=unix:/run/user/1000/pulse/native # Optional, in case PulseAudio is needed
73+
xvfb-run --auto-servernum python -m pytest tests/ -vv --maxfail=1 --disable-warnings

0 commit comments

Comments
 (0)