Skip to content

Commit 4a1bb93

Browse files
authored
Merge pull request #324 from kinde-oss/ci/workflow
ci: add CI workflow
2 parents f832724 + eb8d671 commit 4a1bb93

File tree

4 files changed

+171
-89
lines changed

4 files changed

+171
-89
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
main:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@v3
19+
with:
20+
version: 8
21+
- name: Setting up Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: "pnpm"
26+
- name: Enabling pre-post scripts
27+
run: pnpm config set enable-pre-post-scripts true
28+
- run: pnpm install
29+
# - run: pnpm lint
30+
- name: Cache pnpm modules
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.pnpm-store
34+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-
37+
- run: pnpm build
38+
- run: pnpm test:coverage
39+
# - name: Upload coverage reports to Codecov
40+
# uses: codecov/codecov-action@v5.4.0
41+
# with:
42+
# token: ${{ secrets.CODECOV_TOKEN }}

eslint.config.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import globals from "globals";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import js from "@eslint/js";
6+
import { FlatCompat } from "@eslint/eslintrc";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default defineConfig([
17+
globalIgnores(["**/node_modules", "**/dist", "**/.DS_Store", "**/coverage"]),
18+
{
19+
extends: compat.extends("eslint:recommended", "prettier"),
20+
21+
languageOptions: {
22+
globals: {
23+
...globals.browser,
24+
},
25+
26+
ecmaVersion: 13,
27+
sourceType: "module",
28+
},
29+
rules: {},
30+
},
31+
]);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"test": "vitest",
6262
"test:coverage": "vitest --coverage",
6363
"release": "release-it",
64-
"lint": "eslint --ignore-path .eslintignore",
64+
"lint": "eslint",
6565
"lint:fix": "prettier --write .",
6666
"dev": "cd playground && pnpm run dev"
6767
},
@@ -95,6 +95,7 @@
9595
"release-it": "^18.1.2",
9696
"rollup": "^4.34.6",
9797
"rollup-plugin-terser": "^7.0.2",
98+
"tslib": "^2.8.1",
9899
"typescript": "^5.7.3",
99100
"vitest": "^3.0.5"
100101
},

0 commit comments

Comments
 (0)