create pr gate workflow

This commit is contained in:
Benjamin Palko 2024-12-19 22:49:03 -05:00
parent abc30a2a03
commit a34c020354
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:
build:
name: Test & Build
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 .", "format": "prettier --write .",
"lint": "prettier --check . && eslint .", "lint": "prettier --check . && eslint .",
"test:unit": "vitest", "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", "storybook": "storybook dev -p 6006",
"build-storybook": "storybook build", "build-storybook": "storybook build",
"test:e2e": "playwright test", "test:e2e": "playwright test",
@ -20,7 +20,8 @@
"prisma:generate": "prisma generate", "prisma:generate": "prisma generate",
"prisma:push": "prisma db push", "prisma:push": "prisma db push",
"prisma:reset": "prisma migrate reset --force", "prisma:reset": "prisma migrate reset --force",
"prisma:studio": "prisma studio" "prisma:studio": "prisma studio",
"prisma:validate": "prisma validate"
}, },
"devDependencies": { "devDependencies": {
"@chromatic-com/storybook": "^3.2.2", "@chromatic-com/storybook": "^3.2.2",

View file

@ -2,7 +2,7 @@ import { defineConfig } from '@playwright/test';
export default defineConfig({ export default defineConfig({
webServer: { webServer: {
command: 'npm run build && npm run preview', command: 'bun run build && bun run preview',
port: 4173, port: 4173,
}, },