diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cc6337b2..0ffedd8ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,15 +7,8 @@ on: branches: [main] jobs: - ci: + lint: runs-on: ubuntu-latest - timeout-minutes: 15 - permissions: - contents: read - pull-requests: write - strategy: - matrix: - task: [lint, test, e2e] steps: - name: Checkout uses: actions/checkout@v5 @@ -34,33 +27,73 @@ jobs: - name: Install dependencies run: pnpm install - - name: Install Playwright Browsers - if: matrix.task == 'e2e' - run: pnpm playwright install --with-deps - - name: Run lint - if: matrix.task == 'lint' run: pnpm lint:ci + unit_tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + - name: Run tests - if: matrix.task == 'test' run: pnpm test:ci - - name: Run e2e tests - if: matrix.task == 'e2e' - env: - AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }} - run: pnpm test:e2e:headless - - name: Upload coverage artifact - if: matrix.task == 'test' && github.event_name == 'pull_request' + if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: vitest-coverage path: vitest-coverage + e2e_tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright Browsers + run: pnpm playwright install --with-deps + + - name: Run e2e tests + env: + AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }} + run: pnpm test:e2e:headless + - name: Upload Playwright report - if: matrix.task == 'e2e' && failure() + if: failure() uses: actions/upload-artifact@v4 with: name: playwright-report @@ -68,7 +101,7 @@ jobs: retention-days: 30 - name: Comment PR with Playwright artifact link - if: matrix.task == 'e2e' && failure() && github.event_name == 'pull_request' + if: failure() && github.event_name == 'pull_request' uses: actions/github-script@v7 with: script: | @@ -96,3 +129,26 @@ jobs: repo: repo.repo, body: comment }); + + report_coverage: + runs-on: ubuntu-latest + needs: unit_tests + if: always() && github.event_name == 'pull_request' + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - name: Download Coverage Artifact + uses: actions/download-artifact@v4 + with: + name: vitest-coverage + path: vitest-coverage + + - name: Report Coverage + uses: davelosert/vitest-coverage-report-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + json-summary-path: vitest-coverage/coverage-summary.json + json-final-path: vitest-coverage/coverage-final.json + file-coverage-mode: changes diff --git a/.github/workflows/report_coverage.yml b/.github/workflows/report_coverage.yml deleted file mode 100644 index 1cfc35341..000000000 --- a/.github/workflows/report_coverage.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Report Coverage - -on: - workflow_run: - workflows: ["CI"] - types: [completed] - -jobs: - report: - runs-on: ubuntu-latest - - permissions: - pull-requests: write - - steps: - - uses: actions/checkout@v4 - - - name: Download Coverage Artifact - uses: actions/download-artifact@v4 - with: - name: vitest-coverage - path: vitest-coverage - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - - name: Get PR number - id: PR - uses: 8BitJonny/gh-get-current-pr@3.0.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - sha: ${{ github.event.workflow_run.head_sha }} - filterOutClosed: true - filterOutDraft: true - - - name: Report Coverage - if: success() && steps.PR.outputs.number - uses: davelosert/vitest-coverage-report-action@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - json-summary-path: vitest-coverage/coverage-summary.json - json-final-path: vitest-coverage/coverage-final.json - pr-number: ${{ steps.PR.outputs.number }} - file-coverage-mode: changes - comment-on: pr diff --git a/common/styles/variables.css b/common/styles/variables.css index 0330877e0..3922df81d 100644 --- a/common/styles/variables.css +++ b/common/styles/variables.css @@ -1,4 +1,4 @@ -/* IMPORTANT: Please run `yarn storybook` when file changes to update `./themeMap.js` */ +/* IMPORTANT: Please run `pnpm storybook` when file changes to update `./themeMap.js` */ :root { /* Colors */ --primary: #3ed6f0; /* cerulean */