diff --git a/.github/workflows/api_build.yaml b/.github/workflows/checks.yaml similarity index 50% rename from .github/workflows/api_build.yaml rename to .github/workflows/checks.yaml index 697ebeab..d6dfeb28 100644 --- a/.github/workflows/api_build.yaml +++ b/.github/workflows/checks.yaml @@ -1,8 +1,7 @@ -name: Build API +name: Checks on: - push - - pull_request - workflow_dispatch jobs: @@ -42,3 +41,40 @@ jobs: - name: Build run: pnpm api:build + + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Biome lint + run: pnpm run -r "check" diff --git a/apps/api/package.json b/apps/api/package.json index 88b654e4..bcd010a8 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -12,7 +12,8 @@ "prisma:generate": "prisma generate", "prisma:reset": "prisma migrate reset --force", "prisma:studio": "prisma studio", - "postinstall": "prisma generate" + "postinstall": "prisma generate", + "check": "biome check" }, "dependencies": { "@6pm/validation": "workspace:^", diff --git a/packages/currency/package.json b/packages/currency/package.json index 83817427..92fe4230 100644 --- a/packages/currency/package.json +++ b/packages/currency/package.json @@ -4,7 +4,7 @@ "description": "", "main": "src/index.ts", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "check": "biome check" }, "keywords": [], "author": "", diff --git a/packages/validation/package.json b/packages/validation/package.json index 83afb4f1..5dc7fdde 100644 --- a/packages/validation/package.json +++ b/packages/validation/package.json @@ -4,7 +4,7 @@ "description": "Zod schemas", "main": "src/index.ts", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "check": "biome check" }, "keywords": [], "author": "",