CI/CD Integration
Run Oorty tests in your continuous integration pipeline.
GitHub Actions
Oorty generates a GitHub Actions workflow during initialization. You can also add it manually:
.github/workflows/test.yml
# .github/workflows/test.ymlname: Teston: push: branches: [main, develop] pull_request: branches: [main]jobs: unit-tests: name: Unit & Component Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Run unit tests run: npm run test:unit -- --coverage - name: Run component tests run: npm run test:component - name: Upload coverage uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage/lcov.info fail_ci_if_error: true e2e-tests: name: E2E Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install dependencies run: npm ci - name: Install Playwright browsers run: npx playwright install --with-deps chromium - name: Build application run: npm run build - name: Run E2E tests run: npm run test:e2e - name: Upload Playwright report uses: actions/upload-artifact@v4 if: always() with: name: playwright-report path: playwright-report/ retention-days: 30Other CI Providers
.gitlab-ci.yml
# .gitlab-ci.ymlstages: - testvariables: NODE_VERSION: "20".node-base: image: node:${NODE_VERSION} cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ before_script: - npm ciunit-tests: extends: .node-base stage: test script: - npm run test:unit -- --coverage coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/' artifacts: reports: coverage_report: coverage_format: cobertura path: coverage/cobertura-coverage.xmlcomponent-tests: extends: .node-base stage: test script: - npm run test:componente2e-tests: extends: .node-base stage: test image: mcr.microsoft.com/playwright:v1.41.0-jammy script: - npm run build - npm run test:e2e artifacts: when: always paths: - playwright-report/ expire_in: 7 daysVercel Integration
Run tests before deploying to Vercel:
Preview Deployments
Test before merge
E2E tests run against Vercel preview URLs automatically when configured with GitHub Actions.
Build Checks
Block broken builds
Configure GitHub required status checks to prevent merging when tests fail.
.github/workflows/test.yml
# Test against Vercel preview deploymentse2e-vercel: name: E2E on Preview runs-on: ubuntu-latest needs: [unit-tests] steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Install dependencies run: npm ci - name: Install Playwright run: npx playwright install --with-deps chromium - name: Wait for Vercel Preview uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 id: vercel_preview with: token: ${{ secrets.GITHUB_TOKEN }} max_timeout: 300 - name: Run E2E tests run: npm run test:e2e env: BASE_URL: ${{ steps.vercel_preview.outputs.url }}Environment Variables
Common environment variables for CI:
| Variable | Description | Default |
|---|---|---|
| CI | Indicates CI environment | auto |
| PLAYWRIGHT_TEST_BASE_URL | Base URL for E2E tests | http://localhost:3000 |
| VITEST_COVERAGE | Enable coverage in CI | true |
| CODECOV_TOKEN | Codecov upload token | required |
Best Practices
Run fast tests first
Unit tests should run before E2E tests. Fail fast to save CI minutes.
Cache dependencies
Always cache node_modules and Playwright browsers between runs.
Parallelize when possible
Run unit and component tests in parallel to reduce total CI time.
Save artifacts on failure
Always upload Playwright traces and screenshots for debugging failed tests.