-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add expected patterns, pnpm migration, docs & CI overhaul #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
39724c2
bf85395
d58dc3d
cd3157a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| name: Run tests | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_call: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - '!dependabot/**' | ||
| paths: | ||
| - src/** | ||
| - tests/** | ||
| - '!docs/**' | ||
| - package.json | ||
| - package-lock.json | ||
| - svelte.config.* | ||
| - vite.config.* | ||
| - playwright.config.* | ||
| - tsconfig*.json | ||
| - .github/workflows/run-tests.yml | ||
|
|
||
| concurrency: | ||
| group: run-tests-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 # trunk-ignore(actionlint/runner-label) | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 1 | ||
|
|
||
| - uses: pnpm/action-setup@v4 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js - 24 | ||
| uses: actions/setup-node@v6 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Cache build artifacts | ||
| uses: actions/cache@v5 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| path: | | ||
| .svelte-kit | ||
| dist | ||
| key: ${{ runner.os }}-build-${{ hashFiles('src/**/*', 'pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-build- | ||
|
|
||
| - name: Cache vitest artifacts | ||
| uses: actions/cache@v5 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| path: | | ||
| node_modules/.vitest | ||
| test-results | ||
| key: ${{ runner.os }}-vitest-${{ hashFiles('pnpm-lock.yaml', 'src/**/*.{test,spec}.{js,ts}', 'tests/**/*.{test,spec}.{js,ts}', 'vitest.config.ts') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-vitest- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| pnpm build | ||
| pnpm test | ||
|
|
||
| - name: Upload unit test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| name: unit-test-results | ||
| path: | | ||
| coverage/** | ||
| test-results/** | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
|
|
||
| e2e-tests: | ||
| needs: unit-tests | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 # trunk-ignore(actionlint/runner-label) | ||
| timeout-minutes: 25 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - shard: 1/2 | ||
| shard_name: 1-2 | ||
| - shard: 2/2 | ||
| shard_name: 2-2 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 1 | ||
|
|
||
| - uses: pnpm/action-setup@v4 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js - 24 | ||
| uses: actions/setup-node@v6 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Cache Playwright browsers | ||
| uses: actions/cache@v5 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| path: ~/.cache/ms-playwright | ||
| key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-playwright- | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: pnpm exec playwright install --with-deps | ||
|
|
||
| - name: Sanity check - list discovered tests | ||
| run: pnpm exec playwright test --list | head -n 50 | cat | ||
|
|
||
| - name: Run e2e tests (sharded) | ||
| env: | ||
| CI: true | ||
| run: pnpm exec playwright test --config=playwright.config.ts --shard=${{ matrix.shard }} --reporter=line | ||
|
|
||
|
Comment on lines
+115
to
+136
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "playwright.config.ts" -o -name "playwright.config.js" | head -5Repository: humanspeak/svelte-diff-match-patch Length of output: 100 🏁 Script executed: find . -name "package.json" | head -3Repository: humanspeak/svelte-diff-match-patch Length of output: 112 🏁 Script executed: cat -n playwright.config.tsRepository: humanspeak/svelte-diff-match-patch Length of output: 1395 🏁 Script executed: cat -n package.jsonRepository: humanspeak/svelte-diff-match-patch Length of output: 5017 Build step is required and missing. Additionally, 🤖 Prompt for AI Agents |
||
| - name: Upload Playwright artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 # zizmor: ignore[unpinned-uses] | ||
| with: | ||
| name: playwright-artifacts-${{ matrix.shard_name }} | ||
| path: | | ||
| playwright-report/** | ||
| test-results/** | ||
| blob-report/** | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
pnpm-lock.yamlto the workflow path filters.Dependency-only changes to the pnpm lockfile won’t trigger this workflow, so tests can be skipped.
🔧 Proposed fix
paths: - src/** - tests/** - '!docs/**' - package.json + - pnpm-lock.yaml - package-lock.json - svelte.config.* - vite.config.* - playwright.config.* - tsconfig*.json📝 Committable suggestion
🤖 Prompt for AI Agents