create pr gate workflow (#22)

* create pr gate workflow

* try this
This commit is contained in:
Baobeld 2024-12-19 22:53:12 -05:00 committed by GitHub
parent abc30a2a03
commit 264f6d775d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 11 deletions

23
.github/workflows/pr.yaml vendored Normal file
View file

@ -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

View file

@ -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();
});

View file

@ -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"
}
}
}

View file

@ -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',
});
});