From 264f6d775d21195813ee34701ce0028311658daa Mon Sep 17 00:00:00 2001 From: Baobeld Date: Thu, 19 Dec 2024 22:53:12 -0500 Subject: [PATCH] create pr gate workflow (#22) * create pr gate workflow * try this --- .github/workflows/pr.yaml | 23 +++++++++++++++++++++++ e2e/demo.test.ts | 6 ------ package.json | 7 ++++--- playwright.config.ts | 4 ++-- 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..bf2bb31 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,23 @@ +name: PR Gate +on: + pull_request: + branches: ['*'] +jobs: + checks: + name: Checks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Bun Setup + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - name: Install + run: bun install + - name: Test + run: bun test + - name: Build + run: bun run build + - name: Prisma Schema Check + run: bun prisma:validate \ No newline at end of file diff --git a/e2e/demo.test.ts b/e2e/demo.test.ts index 9985ce1..e69de29 100644 --- a/e2e/demo.test.ts +++ b/e2e/demo.test.ts @@ -1,6 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test('home page has expected h1', async ({ page }) => { - await page.goto('/'); - await expect(page.locator('h1')).toBeVisible(); -}); diff --git a/package.json b/package.json index a909d73..9bf4669 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "format": "prettier --write .", "lint": "prettier --check . && eslint .", "test:unit": "vitest", - "test": "npm run test:unit -- --run && npm run test:e2e", + "test": "bun run test:unit -- --run && bun run test:e2e", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "test:e2e": "playwright test", @@ -20,7 +20,8 @@ "prisma:generate": "prisma generate", "prisma:push": "prisma db push", "prisma:reset": "prisma migrate reset --force", - "prisma:studio": "prisma studio" + "prisma:studio": "prisma studio", + "prisma:validate": "prisma validate" }, "devDependencies": { "@chromatic-com/storybook": "^3.2.2", @@ -75,4 +76,4 @@ "tailwind-merge": "^2.5.5", "zod": "^3.24.0" } -} +} \ No newline at end of file diff --git a/playwright.config.ts b/playwright.config.ts index 07b7bd2..01da0bd 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -2,9 +2,9 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ webServer: { - command: 'npm run build && npm run preview', + command: 'bun run build && bun run preview', port: 4173, }, testDir: 'e2e', -}); +}); \ No newline at end of file