From 4e730e0c5b95c922b39cbddfa5b2773584b117f5 Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Fri, 7 Aug 2026 08:06:26 +0200 Subject: [PATCH] ci: add core import verification and botty module import tests --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e27c79..61d2f11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,8 @@ concurrency: cancel-in-progress: true jobs: - test: - name: Tests (Windows) + install-and-test: + name: Install & Test (Windows) runs-on: windows-latest steps: - name: Checkout @@ -39,6 +39,75 @@ jobs: PYTHONPATH: ./src run: python -m compileall -q src tools test scripts + - name: Verify core imports + env: + PYTHONPATH: ./src + run: | + python -c " + import sys + sys.path.insert(0, 'src') + modules = [ + 'config', + 'logger', + 'screen', + 'pather', + 'template_finder', + 'game_stats', + 'health_manager', + 'death_manager', + 'd2r_image', + 'item', + 'item.pickit', + 'transmute', + 'shop', + 'char', + 'utils', + 'utils.os_detect', + 'messages', + ] + for mod in modules: + try: + __import__(mod) + print(f' {mod}: OK') + except ImportError as e: + print(f' {mod}: FAILED - {e}') + sys.exit(1) + print('All core imports successful.') + " + + - name: Verify botty runs (import main module) + env: + PYTHONPATH: ./src + run: | + python -c " + import sys, os + sys.path.insert(0, 'src') + # Same SSL patch as main.py + import ssl + ssl.SSLContext.load_default_certs = lambda *a, **k: None + + # Import the main entry point modules to verify they load + from version import __version__ + print(f' Version: {__version__}') + + from config import Config + print(' Config: OK') + + from game_controller import GameController + print(' GameController: OK') + + from bot import Bot + print(' Bot: OK') + + from run.run_diablo import RunDiablo + print(' RunDiablo: OK') + + from run.run_pindle import RunPindle + print(' RunPindle: OK') + + print('All botty entry modules import successfully.') + " + - name: Tests with coverage env: PYTHONPATH: ./src