diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9c4f4a3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + name: Test and Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Setup Bun + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Lint code + run: bun run lint + + - name: Build userscript (test) + run: bun run build:userscript + + - name: Build apps (test) + run: bun run build:apps diff --git a/biome.json b/biome.json index 21bfa50..4e8c576 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json", + "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -20,6 +20,15 @@ "recommended": true, "style": { "noNonNullAssertion": "warn" + }, + "correctness": { + "useExhaustiveDependencies": "warn" + }, + "suspicious": { + "noArrayIndexKey": "warn" + }, + "security": { + "noDangerouslySetInnerHtml": "warn" } } }, diff --git a/package.json b/package.json index ffa6329..728d1c2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ }, "scripts": { "lint": "biome lint", - "format": "biome format --write" + "format": "biome format --write", + "build:userscript": "bun run -F './packages/colorproven-userscript' build", + "build:apps": "bun run -F './apps/*' build" }, "devDependencies": { "@biomejs/biome": "2.3.11",