diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml new file mode 100644 index 0000000..742f1e1 --- /dev/null +++ b/.github/workflows/browser-tests.yml @@ -0,0 +1,35 @@ +name: Browser Tests + +on: + workflow_dispatch: + schedule: + - cron: "0 10 * * 1" + +concurrency: + group: browser-tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + chromium: + name: Chromium browser tests + runs-on: ubuntu-latest + timeout-minutes: 30 + + 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: Run browser validation + run: npm run validate:browsers \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..28b336d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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: Package quality checks + runs-on: ubuntu-latest + timeout-minutes: 10 + + 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 + run: npm run validate:ci \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6c93e6c..072318c 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -5,18 +5,26 @@ 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/ @@ -25,10 +33,10 @@ jobs: - 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 env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5d02b7b..fc12d21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "interactive-surface-css", - "version": "1.2.4", + "version": "1.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "interactive-surface-css", - "version": "1.2.4", + "version": "1.2.5", "license": "MIT", "devDependencies": { "@playwright/test": "^1.57.0", diff --git a/package.json b/package.json index bcf0637..2153180 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "interactive-surface-css", - "version": "1.2.4", + "version": "1.2.5", "description": "A framework-agnostic, accessible CSS interaction primitive for buttons, cards, and icon controls with token-driven theming.", "keywords": [ "css", @@ -64,15 +64,25 @@ "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": "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", + "bundle": "node ./scripts/build.mjs bundle", "minify": "node ./scripts/build.mjs minify", - "build": "node ./scripts/build.mjs" + "build": "node ./scripts/build.mjs", + + "test": "playwright test --config=./playwright.config.mjs", + "test:chromium": "playwright test --config=./playwright.config.mjs --project=chromium", + "test:install": "playwright install --with-deps chromium firefox webkit", + "test:install:chromium": "playwright install chromium --with-deps --only-shell", + + "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", + "validate:browsers": "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" }, "devDependencies": { "@playwright/test": "^1.57.0",