Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .github/actions/setup-and-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,47 @@ runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- uses: actions/setup-node@v4
- name: Set node version to ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: "https://registry.npmjs.org"

- name: Resolve package versions
id: resolve-package-versions
shell: bash
run: >
echo "$(
node -e "
const fs = require('fs');
const lockfile = fs.readFileSync('./pnpm-lock.yaml', 'utf8');
const pattern = (name) => new RegExp(name + ':\\\s+specifier: [\\\s\\\w\\\.^]+version: (\\\d+\\\.\\\d+\\\.\\\d+)');
const playwrightVersion = lockfile.match(pattern('playwright'))[1];
console.log('PLAYWRIGHT_VERSION=' + playwrightVersion);
"
)" >> $GITHUB_OUTPUT

- name: Print versions
shell: bash
run: echo "${{ toJson(steps.resolve-package-versions.outputs) }}"

- name: Check resolved package versions
shell: bash
if: |
contains(fromJSON('[null, "", "undefined"]'), steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION)
run: echo "Failed to resolve package versions. See log above." && exit 1

- name: Cache Playwright v${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
uses: actions/cache@v4
id: playwright-cache
with:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
key: ${{ runner.os }}-playwright-${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-

- uses: actions/cache@v4
with:
path: |
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
pull_request:
workflow_dispatch:

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,11 +39,19 @@ jobs:
run: pnpm typecheck

- name: Install Playwright Dependencies
run: pnpm exec playwright install chromium --with-deps
run: pnpm exec playwright install chromium firefox --with-deps

- name: Test
run: pnpm test

- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: vitest-screenshots
path: test/__screenshots__
retention-days: 30

publish-preview:
runs-on: ubuntu-latest
if: ${{ false }} # TODO: Set up preview deployments
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- minor
- major

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright

jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default defineConfig({
test: {
browser: {
enabled: true,
provider: "playwright",
instances: [{ browser: "chromium" }],
},
},
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"prettier": "^3.5.3",
"tsup": "^8.4.0",
"typescript": "^5.8.3",
"vitest": "^3.1.1"
"vitest": "^3.1.1",
"webdriverio": "^9.12.5"
},
"prettier": {}
}
Loading