From 72ff52ee485d7a680ae897c33c027888c6fd7d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramirez=20Vargas=2C=20Jos=C3=A9=20Pablo?= Date: Mon, 22 Jun 2026 22:38:11 -0600 Subject: [PATCH] cicd: Add workflows --- .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 18 ++++++++++++++++++ package.json | 5 +++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6fb63d9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + npm-tag: + description: 'NPM tag to publish the package (e.g., latest, beta, etc.)' + required: false + default: 'latest' + type: string + dry-run: + description: 'Perform a dry run (true/false)' + required: false + default: false + type: boolean + +permissions: + contents: read + id-token: write + +jobs: + publish: + uses: collagejs/cicd/.github/workflows/npm-publish.yml@main + with: + node-version: 24 + build-script: build + test-script: test:cicd + npm-tag: ${{ inputs.npm-tag || 'latest' }} + dry-run: ${{ inputs.dry-run || false }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..73033dc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Test + +on: + pull_request: + branches: [main] + paths: + - 'src/**' + - 'package.json' + - 'tsconfig.json' + +jobs: + test: + uses: collagejs/cicd/.github/workflows/npm-test.yml@main + with: + node-version: 24 + build-script: build + test-script: test:cicd + build: false \ No newline at end of file diff --git a/package.json b/package.json index 51290af..071df8e 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,9 @@ "dist" ], "scripts": { - "test": "vitest run --browser.enabled", - "test:watch": "vitest --browser.enabled", + "test": "vitest run", + "test:cicd": "npx playwright install && npm run test", + "test:watch": "vitest", "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"", "build:types": "tsc -p tsconfig.build.json", "build": "npm run clean && vite build && npm run build:types && publint"