name: Aegis CI on: push: paths: - 'Aegis-Labyrinth.html' - 'tests/*.mjs' - '.gitea/workflows/aegis.yml' pull_request: paths: - 'Aegis-Labyrinth.html' - 'tests/*.mjs' - '.gitea/workflows/aegis.yml' schedule: - cron: '0 2 * * *' # Nightly: 02:00 UTC workflow_dispatch: jobs: audit: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: gitea/checkout - uses: gitea/setup-node with: node-version: 20 - name: Install Playwright + Chromium run: npm i playwright && npx playwright install --with-deps chromium - name: Run audits run: node tests/audit.mjs - name: Assert audit results run: | node -e " const r = JSON.parse(require('fs').readFileSync('audit-result.json','utf8')); const fail = []; // 1) Connectivity: jede Welle start- & exit-reachbar. if (!r.self.connectivity.every(c => c.reachable && c.exit)) fail.push('connectivity'); // 2) Attacks: jeder Turm muss entweder Projektile, Holos oder Schaden erzeugen. const badAttacks = r.self.attacks.filter(a => (a.projectiles||0)===0 && (a.holos||0)===0 && a.hurt===false); if (badAttacks.length) fail.push('attacks:' + badAttacks.map(a=>a.id).join(',')); // 3) Skills: alle Skills müssen Rank >= 4 erreichen. if (r.self.skills.some(s => (s.rank||0) < 4)) fail.push('skills'); // 4) Placement: Wall akzeptiert, Path abgelehnt. if (!r.self.placement || r.self.placement.wallAccepted === false || r.self.placement.pathAccepted === true) fail.push('placement'); if (fail.length) { console.error('FAIL:', fail.join(' | ')); process.exit(1); } console.log('✅ All audits passed'); " - name: Upload audit artifact if: always() uses: gitea/upload-artifact with: name: audit-result path: audit-result.json perf: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: gitea/checkout - uses: gitea/setup-node with: node-version: 20 - run: npm i playwright && npx playwright install --with-deps chromium - name: FPS measurement run: node tests/perf-test.mjs 10000 50 - name: Upload perf artifact if: always() uses: gitea/upload-artifact with: name: perf-result path: perf-result.json selfplay: needs: audit if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: gitea/checkout - uses: gitea/setup-node with: node-version: 20 - run: npm i playwright && npx playwright install --with-deps chromium - name: Run 50 self-play episodes run: node tests/selfplay.mjs 50 - name: Upload self-play artifact if: always() uses: gitea/upload-artifact with: name: selfplay-results path: selfplay-results.json report: needs: [audit, perf] if: always() runs-on: ubuntu-latest steps: - uses: gitea/checkout - uses: gitea/setup-node with: node-version: 20 - name: Download artifacts uses: gitea/download-artifact - name: Build HTML report run: node tests/report.mjs - name: Upload report uses: gitea/upload-artifact with: name: report path: report.html