From 3bd1b2e32f70d4668bb75936bae45e6e17534c04 Mon Sep 17 00:00:00 2001 From: Matt Hamlin Date: Mon, 1 Apr 2024 08:26:30 -0400 Subject: [PATCH] Add GitHub actions setup to run quality checks --- .github/workflows/code-quality.yaml | 26 ++++++++++++++++++++++ package.json | 6 +++-- packages/pkg-a/package.json | 3 ++- packages/pkg-a/src/__tests__/index.test.ts | 5 +++++ turbo.json | 5 ++++- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/code-quality.yaml create mode 100644 packages/pkg-a/src/__tests__/index.test.ts diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 0000000..6540557 --- /dev/null +++ b/.github/workflows/code-quality.yaml @@ -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 diff --git a/package.json b/package.json index e85c25c..60384c2 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/packages/pkg-a/package.json b/packages/pkg-a/package.json index 41b4232..c07fa9f 100644 --- a/packages/pkg-a/package.json +++ b/packages/pkg-a/package.json @@ -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" } } diff --git a/packages/pkg-a/src/__tests__/index.test.ts b/packages/pkg-a/src/__tests__/index.test.ts new file mode 100644 index 0000000..2df36ea --- /dev/null +++ b/packages/pkg-a/src/__tests__/index.test.ts @@ -0,0 +1,5 @@ +import { expect, test } from "bun:test"; + +test("pkg-a", () => { + expect("pkg-a").toBe("pkg-a"); +}); diff --git a/turbo.json b/turbo.json index dd8b0e2..f371722 100644 --- a/turbo.json +++ b/turbo.json @@ -8,6 +8,9 @@ "type-check": { "dependsOn": ["^build"] }, - "lint": {} + "lint": {}, + "test": { + "dependsOn": ["^build"] + } } }