Remove CI

This commit is contained in:
Félix MARQUET
2025-03-25 11:35:09 +01:00
parent e2b61295c0
commit 4f45b831e5

View File

@@ -1,99 +0,0 @@
name: Game CI
on:
pull_request:
branches: [ main, dev ]
jobs:
test-game:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get update
sudo apt-get install -y xvfb
- name: Create test version of game
run: |
cat > ci_pygame_test.py << 'EOF'
import pygame
from pygame.locals import *
import sys
import os
import time
def test_game():
pygame.init()
# Use window mode instead of fullscreen for CI
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Project Sanic - CI Test")
# Create dummy assets to avoid file not found errors
os.makedirs("assets/player", exist_ok=True)
clock = pygame.time.Clock()
start_time = time.time()
test_passed = False
try:
# Try to import and run key functions from the game
from pygame_basics import Player, platform
# Create test objects
test_platform = platform()
test_platform.surf = pygame.Surface((800, 20))
test_platform.rect = test_platform.surf.get_rect(center=(400, 500))
test_player = Player()
# Run for 3 seconds
while time.time() - start_time < 3:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
return True
screen.fill((0, 0, 0))
# Test player movement and update functions
test_player.move()
test_player.update()
# Display success message
font = pygame.font.Font(None, 36)
text = font.render("CI Test Running...", True, (0, 255, 0))
screen.blit(text, (300, 250))
pygame.display.flip()
clock.tick(60)
test_passed = True
except Exception as e:
print(f"Test failed with error: {e}")
return False
finally:
pygame.quit()
return test_passed
if __name__ == "__main__":
success = test_game()
print(f"Game test {'passed' if success else 'failed'}")
sys.exit(0 if success else 1)
EOF
- name: Run game test with Xvfb
run: |
xvfb-run --auto-servernum python ci_pygame_test.py