ci: add Biome linter and test suite action for PRs
Swadhin Biswas committed 7 months ago
be05999
1 parent 7add3b3
commit be05999
2 files changed
+91 -0
Showing 2 changed files+91-0
▼opengrammar/.github/workflows/ci.yml
+44-0
| @@ -0,0 +1,44 @@ | ||
1 | +name: CI & Code Review | |
2 | + | |
3 | +on: | |
4 | + push: | |
5 | + branches: [ "main" ] | |
6 | + pull_request: | |
7 | + branches: [ "main" ] | |
8 | + | |
9 | +jobs: | |
10 | + review-and-test: | |
11 | + name: Code Quality & Tests | |
12 | + runs-on: ubuntu-latest | |
13 | + steps: | |
14 | + - name: Checkout Code | |
15 | + uses: actions/checkout@v4 | |
16 | + | |
17 | + - name: Setup Bun | |
18 | + uses: oven-sh/setup-bun@v1 | |
19 | + with: | |
20 | + bun-version: latest | |
21 | + | |
22 | + - name: Setup Node | |
23 | + uses: actions/setup-node@v4 | |
24 | + with: | |
25 | + node-version: 20 | |
26 | + | |
27 | + - name: Install Dependencies | |
28 | + run: | | |
29 | + cd backend && bun install | |
30 | + cd ../extension && npm install | |
31 | + | |
32 | + - name: 🔍 Biome Linter & Formatter Check | |
33 | + # Uses Biome to review your code (fast Rust-based alternative to ESLint/Prettier) | |
34 | + # It will output annotations directly into the PR files tab | |
35 | + run: npx @biomejs/biome ci ./backend/src ./backend/tests ./extension/src | |
36 | + | |
37 | + - name: ⚙️ TypeScript Type Check (Backend) | |
38 | + run: cd backend && npx tsc --noEmit | |
39 | + | |
40 | + - name: ⚙️ TypeScript Type Check (Extension) | |
41 | + run: cd extension && npx tsc --noEmit | |
42 | + | |
43 | + - name: 🧪 Run Backend Tests | |
44 | + run: cd backend && bun test | |
0 | 45 | |
▼opengrammar/biome.json
+47-0
| @@ -0,0 +1,47 @@ | ||
1 | +{ | |
2 | + "$schema": "https://biomejs.dev/schemas/2.4.9/schema.json", | |
3 | + "vcs": { | |
4 | + "enabled": false, | |
5 | + "clientKind": "git", | |
6 | + "useIgnoreFile": false | |
7 | + }, | |
8 | + "files": { | |
9 | + "ignoreUnknown": true, | |
10 | + "ignore": [ | |
11 | + "backend/dist", | |
12 | + "extension/dist", | |
13 | + "backend/node_modules", | |
14 | + "extension/node_modules" | |
15 | + ] | |
16 | + }, | |
17 | + "formatter": { | |
18 | + "enabled": true, | |
19 | + "indentStyle": "space", | |
20 | + "indentWidth": 2, | |
21 | + "lineWidth": 100 | |
22 | + }, | |
23 | + "linter": { | |
24 | + "enabled": true, | |
25 | + "rules": { | |
26 | + "recommended": true, | |
27 | + "style": { | |
28 | + "noNonNullAssertion": "off", | |
29 | + "useConst": "off" | |
30 | + }, | |
31 | + "complexity": { | |
32 | + "noForEach": "off" | |
33 | + }, | |
34 | + "suspicious": { | |
35 | + "noExplicitAny": "off", | |
36 | + "noEmptyBlockStatements": "off", | |
37 | + "noConsole": "off", | |
38 | + "noConsoleLog": "off" | |
39 | + } | |
40 | + } | |
41 | + }, | |
42 | + "javascript": { | |
43 | + "formatter": { | |
44 | + "quoteStyle": "single" | |
45 | + } | |
46 | + } | |
47 | +} | |
0 | 48 | |