|
| 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