Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
name: Quality checks
runs-on: ubuntu-latest
timeout-minutes: 20

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Use Node.js 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Validate package and run Chromium tests
run: npm run validate:ci
18 changes: 13 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,36 @@ on:
types: [published]
workflow_dispatch:

concurrency:
group: npm-publish-${{ github.ref }}
cancel-in-progress: false

jobs:
publish:
name: Publish package
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v5

- name: Use Node.js 24
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: npm
package-manager-cache: false

- name: Install dependencies
run: npm ci

- name: Validate package
run: npm run validate
- name: Validate publish package
run: npm run validate:publish

- name: Publish to npm
run: npm publish --provenance --access public --ignore-scripts
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,21 @@
"scripts": {
"check:no-hex-colors": "node ./scripts/check-no-hex-colors.mjs",
"lint:css": "stylelint interactive-surface.css",

"test:install": "playwright install --with-deps chromium firefox webkit",
"test:install:chromium": "playwright install chromium --with-deps --only-shell",
"test": "playwright test --config=./playwright.config.mjs",
"test:chromium": "playwright test --config=./playwright.config.mjs --project=chromium",

"pack:dry": "npm pack --dry-run --cache ./.npm-cache",
"validate": "npm run check:no-hex-colors && npm run lint:css && npm run test:install && npm test && npm run pack:dry",
"prepublishOnly": "npm run check:no-hex-colors && npm run lint:css && npm run pack:dry",

"validate:publish": "npm run check:no-hex-colors && npm run lint:css && npm run build && npm run pack:dry",
"validate:ci": "npm run validate:publish && npm run test:install:chromium && npm run test:chromium",
"validate:full": "npm run validate:publish && npm run test:install && npm test",
"validate": "npm run validate:ci",

"prepublishOnly": "npm run validate:publish",

"bundle": "node ./scripts/build.mjs bundle",
"minify": "node ./scripts/build.mjs minify",
"build": "node ./scripts/build.mjs"
Expand Down
Loading