# Vzor GitHub Actions: kontroly u každého pull requestu. # Soubor ulož jako .github/workflows/ci.yml (bez přípony .txt). # Názvy úloh musí sedět s povinnými kontrolami v pravidlech větve main. name: ci on: pull_request: branches: [main] permissions: contents: read concurrency: group: ci-${{ github.head_ref }} cancel-in-progress: true # nový push zruší starý běh a šetří minuty jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npm run build unit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npm test # unit testy e2e: needs: build runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npx playwright install --with-deps chromium # Server pro testy spouští playwright.config (sekce webServer). - run: npx playwright test # Při selhání uložíme report, aby ho agent-tester mohl přiložit k úkolu. - if: failure() uses: actions/upload-artifact@v4 with: name: playwright-report path: playwright-report/ retention-days: 7