Skip to content

Commit

Permalink
Add GitHub actions setup to run quality checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hamlim committed Apr 1, 2024
1 parent 5ebf11a commit 3bd1b2e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Code Quality Checks

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Run tests
run: bun run test

- name: Run lints
run: bun run lint

- name: Run type-checks
run: bun run type-check

- name: Check formatting
run: bun run format:check
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"scripts": {
"build": "turbo run build ",
"build:packages": "turbo run build --filter=./packages/*",
"type-check": "turbo run type-check --output-logs=errors-only",
"type-check": "turbo run type-check",
"lint": "turbo run lint",
"format": "dprint fmt"
"format": "dprint fmt",
"format:check": "dprint check",
"test": "turbo run test"
}
}
3 changes: 2 additions & 1 deletion packages/pkg-a/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build:types": "tsc -p ./build.tsconfig.json",
"build": "bun run build:source && bun run build:types",
"type-check": "tsc -p ./tsconfig.json",
"lint": "biome lint ./src/"
"lint": "biome lint ./src/",
"test": "bun test"
}
}
5 changes: 5 additions & 0 deletions packages/pkg-a/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { expect, test } from "bun:test";

test("pkg-a", () => {
expect("pkg-a").toBe("pkg-a");
});
5 changes: 4 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"type-check": {
"dependsOn": ["^build"]
},
"lint": {}
"lint": {},
"test": {
"dependsOn": ["^build"]
}
}
}

0 comments on commit 3bd1b2e

Please sign in to comment.