diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 249038c..20a0427 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: true jobs: - test: + check: name: Quality Checks runs-on: ubuntu-latest timeout-minutes: 15 @@ -29,55 +29,3 @@ jobs: - name: Run type checking run: pnpm typecheck - - e2e: - name: E2E Visual Regression Tests - runs-on: ubuntu-latest - timeout-minutes: 15 - if: github.event_name == 'pull_request' - - permissions: - id-token: write - contents: write - - steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Setup Node & pnpm - uses: ./.github/actions/setup-node - - - name: Install Playwright - run: | - sudo npx playwright install-deps - pnpm exec playwright install - - - name: Set up Git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config --local user.email "$(git --no-pager log --format=format:'%ae' -n 1)" - git config --local user.name "$(git --no-pager log --format=format:'%an' -n 1)" - git config --local url."https://oauth2:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - - git pull --rebase origin ${{ github.head_ref }} - - - name: Build project - run: pnpm build - - - name: Capture screenshots - timeout-minutes: 3 - run: pnpm e2e - env: - MAX_CONCURRENCY: 10 - - - name: Commit screenshots - run: | - set -x - - git add e2e/snapshots - git commit -m 'ci(snapshots): update screenshots' - git push origin HEAD:${{ github.head_ref }} diff --git a/.github/workflows/vrt.yml b/.github/workflows/vrt.yml new file mode 100644 index 0000000..e3bc142 --- /dev/null +++ b/.github/workflows/vrt.yml @@ -0,0 +1,62 @@ +name: CI + +on: + pull_request: + types: [labeled] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + e2e: + name: E2E Visual Regression Tests + runs-on: ubuntu-latest + timeout-minutes: 15 + if: github.event.label.name == 'vrt' || contains(github.event.pull_request.labels.*.name, 'vrt') + + permissions: + id-token: write + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node & pnpm + uses: ./.github/actions/setup-node + + - name: Install Playwright + run: | + sudo npx playwright install-deps + pnpm exec playwright install + + - name: Set up Git + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --local user.email "$(git --no-pager log --format=format:'%ae' -n 1)" + git config --local user.name "$(git --no-pager log --format=format:'%an' -n 1)" + git config --local url."https://oauth2:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" + + git pull --rebase origin ${{ github.head_ref }} + + - name: Build project + run: pnpm build + + - name: Capture screenshots + timeout-minutes: 3 + run: pnpm e2e + env: + MAX_CONCURRENCY: 10 + + - name: Commit screenshots + run: | + set -x + + git add e2e/snapshots + git commit -m 'ci(snapshots): update screenshots' + git push origin HEAD:${{ github.head_ref }}