From 6ea3a4e097476c674bd39cf7ddc89de06c748275 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Mon, 24 Jun 2024 10:12:56 -0400 Subject: [PATCH 1/2] chore(ci): Add basic CI --- .eslintignore | 1 + .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 5 +++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.eslintignore b/.eslintignore index 1521c8b..009af54 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ dist +coverage diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f58e1ac --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + env: + CI: true + LINT: ${{ matrix.node-version == '22.x' && true || false }} + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: corepack enable + - run: yarn install + - run: yarn build + - run: yarn test + - run: yarn lint + if: ${{ env.LINT == 'true' }} diff --git a/package.json b/package.json index ce746c5..ba236c4 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,9 @@ "dev": "concurrently \"yarn build:watch\" \"vite --config examples/vite.config.ts --open\"", "test": "vitest --typecheck", "coverage": "vitest run --coverage", - "clean": "rimraf dist/*", - "format": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.eslintignore --write" + "lint": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.eslintignore --check", + "format": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.eslintignore --write", + "clean": "rimraf dist/*" }, "devDependencies": { "@deck.gl/aggregation-layers": "^9.0.14", From 57bc1a2101e8a6e077deb58268cdcb5fdc274448 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Mon, 24 Jun 2024 10:16:11 -0400 Subject: [PATCH 2/2] Update test macro --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ba236c4..f18239f 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "build": "microbundle --format cjs,modern --no-compress --define VERSION=$npm_package_version", "build:watch": "microbundle watch --format cjs,modern --no-compress --define VERSION=$npm_package_version", "dev": "concurrently \"yarn build:watch\" \"vite --config examples/vite.config.ts --open\"", - "test": "vitest --typecheck", + "test": "vitest run --typecheck", + "test:watch": "vitest watch --typecheck", "coverage": "vitest run --coverage", "lint": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.eslintignore --check", "format": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.eslintignore --write",