Skip to content

🧪 Add Automated Tests and GitHub Actions Workflow (Linux-compatible) #11

Description

@6uhrmittag

We want to add a full CI pipeline for this project using GitHub Actions on Windows. This pipeline should:

  • Build the application using the existing built.bat script (via PyInstaller)
  • Run Python unit tests
  • Upload the resulting .exe files as GitHub Actions artifacts

✅ Goal

Implement a GitHub Actions workflow that:

  1. Runs on windows-latest

  2. Executes the build script:

    pyinstaller synth_riders_discordrpc.spec
    pyinstaller synth_riders_discordrpc_uninstall.spec
    pyinstaller synth_riders_discordrpc_setup.spec

    (This is already in built.bat)

  3. Runs Python tests using pytest

  4. Runs optional static analysis, e.g.:

    • flake8
    • black --check
    • mypy
  5. Uploads all .exe binaries as artifacts so they can be downloaded from the GitHub Actions summary


🧪 Test Scope

Tests should live in a /tests folder and use pytest. Focus on:

  • Config parsing and fallback/defaults
  • Album art image decoding & upload logic
  • WebSocket event handling (e.g. SongStart, SongEnd)
  • Discord RPC update logic (can use mocks for pypresence)
  • General utilities

Avoid mocking Windows behavior — we now run tests on Windows!


📁 Project Structure Notes

The entry points built by PyInstaller are defined in these .spec files:

  • synth_riders_discordrpc.spec → main executable
  • synth_riders_discordrpc_uninstall.spec → uninstaller
  • synth_riders_discordrpc_setup.spec → first-time setup

You can run built.bat to produce the full set of executables.


🛠 Tasks

  • Create .github/workflows/windows-build-test.yml

  • Use runs-on: windows-latest

  • Install Python dependencies:

    pip install -r requirements.txt
    pip install pytest flake8 black mypy
  • Run built.bat

  • Run pytest

  • Run flake8, black --check, mypy

  • Upload the built .exe files from dist/ as GitHub Actions artifacts

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions