Přidej podporu pro změnu veřejného slugu služby s auditováním a histo… #1151
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NEXT_PUBLIC_APP_NAME: PP Studio | |
| NEXT_PUBLIC_APP_URL: http://127.0.0.1:3100 | |
| NEXT_PUBLIC_SITE_URL: https://ppstudio.cz | |
| NEXT_PUBLIC_MATOMO_ENABLED: "true" | |
| NEXT_PUBLIC_MATOMO_URL: https://matomo.example.test/ | |
| NEXT_PUBLIC_MATOMO_SITE_ID: "1" | |
| NEXT_PUBLIC_META_PIXEL_ENABLED: "true" | |
| NEXT_PUBLIC_META_PIXEL_ID: "123456789" | |
| DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/ppstudio?schema=public | |
| SHADOW_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/ppstudio_shadow?schema=public | |
| ADMIN_SESSION_SECRET: ci-secret-value-with-at-least-32-characters | |
| ADMIN_OWNER_EMAIL: owner@example.com | |
| ADMIN_OWNER_PASSWORD: change-me-owner | |
| ADMIN_STAFF_EMAIL: staff@example.com | |
| ADMIN_STAFF_PASSWORD: change-me-staff | |
| EMAIL_DELIVERY_MODE: log | |
| SMTP_FROM_NAME: PP Studio | |
| MEDIA_STORAGE_ROOT: /tmp/ppstudio-media | |
| PLAYWRIGHT_PORT: 3100 | |
| PLAYWRIGHT_BASE_URL: http://127.0.0.1:3100 | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test release mechanism | |
| run: npm run test:release-script | |
| - name: Version consistency | |
| run: npm run version:check | |
| typecheck: | |
| name: typecheck | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma client | |
| run: npm run db:generate | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Email worker import smoke test | |
| run: npm run email:worker:check-imports | |
| test: | |
| name: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify voucher production first rollout | |
| timeout-minutes: 8 | |
| run: npm run ci:verify-voucher-first-rollout | |
| - name: Prepare database | |
| run: | | |
| npx prisma migrate deploy | |
| npm run db:generate | |
| - name: Test unit layer with coverage and DB integrations | |
| run: npm run test:ci | |
| - name: Test production security headers | |
| run: NODE_ENV=production node --import ./src/test/register-server-only.mjs --import tsx --test src/config/security-headers.test.ts | |
| - name: Upload coverage artifact | |
| if: always() && hashFiles('coverage/**') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 14 | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Prepare database | |
| run: npx prisma migrate deploy | |
| - name: Build | |
| timeout-minutes: 10 | |
| run: npm run build | |
| e2e-build: | |
| name: e2e build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Prepare database | |
| run: npx prisma migrate deploy | |
| - name: Build E2E distribution | |
| timeout-minutes: 10 | |
| run: npm run pretest:e2e | |
| - name: Upload E2E distribution | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: next-e2e-build | |
| path: | | |
| .next-e2e/ | |
| !.next-e2e/cache/** | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| retention-days: 1 | |
| e2e: | |
| name: e2e | |
| needs: e2e-build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download E2E distribution | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: next-e2e-build | |
| path: .next-e2e | |
| - name: Prepare database | |
| run: | | |
| npx prisma migrate deploy | |
| npm run db:generate | |
| PPSTUDIO_INTEGRATION_FIXTURES=1 npm run ci:prepare-voucher-fixtures | |
| - name: Install Playwright Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: E2E Chromium (shard 1/2) | |
| run: PPSTUDIO_NEXT_DIST_DIR=.next-e2e npx playwright test --fully-parallel --project=chromium --shard=1/2 | |
| - name: Upload Playwright report | |
| if: always() && hashFiles('playwright-report/**') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report-chromium-shard-1 | |
| path: playwright-report/ | |
| retention-days: 14 | |
| e2e-chromium-shard-2: | |
| name: e2e chromium shard 2 | |
| needs: e2e-build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download E2E distribution | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: next-e2e-build | |
| path: .next-e2e | |
| - name: Prepare database | |
| run: | | |
| npx prisma migrate deploy | |
| npm run db:generate | |
| PPSTUDIO_INTEGRATION_FIXTURES=1 npm run ci:prepare-voucher-fixtures | |
| - name: Install Playwright Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: E2E Chromium (shard 2/2) | |
| run: PPSTUDIO_NEXT_DIST_DIR=.next-e2e npx playwright test --fully-parallel --project=chromium --shard=2/2 | |
| - name: Upload Playwright report | |
| if: always() && hashFiles('playwright-report/**') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report-chromium-shard-2 | |
| path: playwright-report/ | |
| retention-days: 14 | |
| e2e-mobile: | |
| name: e2e mobile (${{ matrix.browser.project }}) | |
| needs: e2e-build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: | |
| - project: mobile-chrome | |
| engine: chromium | |
| - project: mobile-safari | |
| engine: webkit | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download E2E distribution | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: next-e2e-build | |
| path: .next-e2e | |
| - name: Prepare database | |
| run: | | |
| npx prisma migrate deploy | |
| npm run db:generate | |
| PPSTUDIO_INTEGRATION_FIXTURES=1 npm run ci:prepare-voucher-fixtures | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps ${{ matrix.browser.engine }} | |
| - name: E2E mobile browser (shard 1/2) | |
| run: PPSTUDIO_NEXT_DIST_DIR=.next-e2e npx playwright test --fully-parallel --project=${{ matrix.browser.project }} --shard=1/2 | |
| - name: Upload Playwright report | |
| if: always() && hashFiles('playwright-report/**') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report-${{ matrix.browser.project }}-shard-1 | |
| path: playwright-report/ | |
| retention-days: 14 | |
| e2e-mobile-shard-2: | |
| name: e2e mobile shard 2 (${{ matrix.browser.project }}) | |
| needs: e2e-build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: | |
| - project: mobile-chrome | |
| engine: chromium | |
| - project: mobile-safari | |
| engine: webkit | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ppstudio | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ppstudio" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download E2E distribution | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: next-e2e-build | |
| path: .next-e2e | |
| - name: Prepare database | |
| run: | | |
| npx prisma migrate deploy | |
| npm run db:generate | |
| PPSTUDIO_INTEGRATION_FIXTURES=1 npm run ci:prepare-voucher-fixtures | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps ${{ matrix.browser.engine }} | |
| - name: E2E mobile browser (shard 2/2) | |
| run: PPSTUDIO_NEXT_DIST_DIR=.next-e2e npx playwright test --fully-parallel --project=${{ matrix.browser.project }} --shard=2/2 | |
| - name: Upload Playwright report | |
| if: always() && hashFiles('playwright-report/**') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report-${{ matrix.browser.project }}-shard-2 | |
| path: playwright-report/ | |
| retention-days: 14 |