diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..c11b2ea --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,78 @@ +# Prueft jeden Push und jeden Pull Request. +# +# Die Datei liegt unter .gitea/workflows und wird von Gitea Actions gelesen. +# Die Syntax ist mit GitHub Actions kompatibel – wer das Repo dorthin +# spiegelt, kopiert sie nach .github/workflows. +# +# Voraussetzung: In der Gitea-Instanz muessen Actions aktiviert sein +# (app.ini: [actions] ENABLED = true) und mindestens ein Runner registriert. + +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + pruefen: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:17-alpine + env: + POSTGRES_USER: nebula + POSTGRES_PASSWORD: nebula + # Der Name muss "test" enthalten – global-setup.ts leert die + # Datenbank und weigert sich bei allem anderen. + POSTGRES_DB: nebula_e2e_test + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U nebula" + --health-interval 5s + --health-timeout 5s + --health-retries 20 + + env: + DATABASE_URL: postgresql://nebula:nebula@localhost:5432/nebula_e2e_test?schema=public + E2E_DATABASE_URL: postgresql://nebula:nebula@localhost:5432/nebula_e2e_test?schema=public + # Nur fuer den Lauf – keine echten Daten im Spiel. + APP_SECRET: ci-lauf-schluessel-nur-fuer-die-pipeline-0123456789 + NEXT_TELEMETRY_DISABLED: "1" + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Abhaengigkeiten + run: npm ci + + - name: Typen pruefen + run: npx tsc --noEmit + + - name: Unit-Tests + run: npm test + + - name: Browser fuer die Oberflaechentests + run: npx playwright install --with-deps chromium + + # Baut zuerst und startet den Server dann selbst (siehe + # playwright.config.ts, webServer). + - name: Ende-zu-Ende-Tests + run: npm run test:e2e + + - name: Bericht bei Fehlschlag sichern + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-bericht + path: | + playwright-report/ + test-results/ + retention-days: 7 diff --git a/src/components/TopNav.tsx b/src/components/TopNav.tsx index d0c4066..b039fe5 100644 --- a/src/components/TopNav.tsx +++ b/src/components/TopNav.tsx @@ -108,6 +108,9 @@ function UserMenu({ user }: { user: SessionUser }) { className="flex items-center gap-2 rounded-xl border border-white/10 bg-white/4 py-1.5 pl-1.5 pr-3 text-sm text-slate-200 transition-colors hover:bg-white/8" aria-haspopup="menu" aria-expanded={open} + // Auf schmalen Anzeigen bleibt nur das Kuerzel sichtbar – ohne + // Beschriftung liest ein Screenreader dann nur zwei Buchstaben vor. + aria-label={`Benutzermenue fuer ${label}`} > {initials}