name: CI on: push: branches: ["main"] pull_request: branches: ["main"] permissions: contents: read jobs: # ---------------------------------------------------------------- compile # Byte-compiles every first-party Python file. Catches syntax errors (e.g. # a misplaced `from __future__` import) without needing any dependencies. compile: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: py_compile first-party sources run: | # Vendored forks (yt_dlp, spotify_dl) are excluded — they ship their # own validity and use syntax not meant for this gate. git ls-files '*.py' \ | grep -vE '^(yt_dlp|spotify_dl)/' \ | xargs python -m py_compile echo "All first-party sources compile." # ------------------------------------------------------------------- unit # Pure-logic tests. The modules under test guard their optional/heavy # dependencies, so only pytest is required. unit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install test deps run: | python -m pip install --upgrade pip pip install pytest - name: Run unit tests run: pytest tests/unit -v # ------------------------------------------------------------ integration # Boots the Flask services (no Discord/network) and exercises their HTTP # surface — primarily the X-Conjurer-Api-Key auth contract end to end. integration: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install service deps run: | python -m pip install --upgrade pip pip install pytest flask waitress requests - name: Run integration tests run: pytest tests/integration -v