Skip to content

Test Adapters Against New Core #9

Test Adapters Against New Core

Test Adapters Against New Core #9

Workflow file for this run

name: Test Adapters Against New Core
# Runs automatically after a successful Release workflow (which publishes core to npm).
# Also triggerable manually to check all adapters at any time.
on:
workflow_run:
workflows: ["Release"]
types: [completed]
workflow_dispatch:
jobs:
test-adapter:
# Only run if the Release workflow succeeded (or if triggered manually)
if: >
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
name: Test ${{ matrix.adapter }}
runs-on: ubuntu-latest
strategy:
fail-fast: false # test all adapters even if one fails
matrix:
adapter:
- adapter-hackernews
- adapter-google-discover
- adapter-linkedin
- adapter-reddit
- adapter-booking
steps:
- uses: actions/checkout@v4
with:
repository: browserkit-dev/${{ matrix.adapter }}
- uses: actions/setup-node@v4
with:
node-version: 20
# Cache node_modules — invalidates only when package-lock.json changes.
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ matrix.adapter }}-${{ hashFiles('package-lock.json') }}
restore-keys: node-modules-${{ runner.os }}-${{ matrix.adapter }}-
- name: Install dependencies
run: npm ci # respects lockfile; skips resolution on cache hit
# Cache Chromium — shared across all matrix legs via restore-keys prefix.
- name: Cache Patchright Chromium
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: patchright-chromium-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: patchright-chromium-${{ runner.os }}-
- name: Install Patchright Chromium
run: npx patchright install chromium --with-deps
- name: Build
run: npm run build
- name: Test
run: npm test
timeout-minutes: 10