diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..cbddcfc --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,34 @@ +name: Validate swup.js.org + +# End-to-end check: `swup validate` against the docs site, +# same as `npm run test:validate` in swup/docs + +on: + push: + branches: [main, master, next] + pull_request: + workflow_dispatch: + +jobs: + validate: + name: Validate swup.js.org + # Playwright 1.55 doesn't support ubuntu 26.04 (ubuntu-latest) yet + runs-on: ubuntu-24.04 + timeout-minutes: 10 + + steps: + - name: Check out repo + uses: actions/checkout@v6 + + - name: Set up node + uses: actions/setup-node@v6 + with: + node-version: 24 + + - run: npm ci + - run: npm run build + - run: npx playwright install --with-deps chromium + + - name: Validate swup.js.org + run: >- + ./bin/run.js validate --parallel --sitemap=https://swup.js.org/sitemap.xml diff --git a/swup.config.js b/swup.config.js index f6683d2..7e3f74d 100644 --- a/swup.config.js +++ b/swup.config.js @@ -1,9 +1,7 @@ +// Mirrors swup.config.mjs in swup/docs export default { swup: { - animationSelector: '[class*="swup-transition-"]' - }, - validate: { - url: 'https://swup.js.org', - limit: 10 + animationSelector: '[class*="swup-transition-"]', + containers: ['#swup'] } };