Skip to content

Commit

Permalink
Add test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
omfj committed Aug 30, 2024
1 parent 1a8458b commit 749ddc4
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@ on:
types: [opened, synchronize]

env:
ADMIN_KEY: foobar
DATABASE_URL: postgres://postgres:postgres@localhost:5432/echo-web
NEXT_PUBLIC_SANITY_DATASET: testing
NEXT_PUBLIC_ARS_URL: http://localhost:4444
FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }}
FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
ci:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15.7
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: echo-web
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install

- run: pnpm db:migrate

- name: Lint
run: pnpm lint

Expand All @@ -44,26 +24,3 @@ jobs:

- name: Check style
run: pnpm format:check

- name: Run unit tests
run: pnpm test:unit

- name: Install playwright browsers
run: pnpm --filter=playwright test:install

- name: Seed database
run: pnpm seed database --mode test

- name: Build
run: pnpm build

- name: Run playwright tests
run: pnpm test:e2e

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright/playwright-report/
retention-days: 30
60 changes: 60 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
pull_request:
types: [opened, synchronize]

env:
ADMIN_KEY: foobar
DATABASE_URL: postgres://postgres:postgres@localhost:5432/echo-web
NEXT_PUBLIC_SANITY_DATASET: testing
NEXT_PUBLIC_ARS_URL: http://localhost:4444
FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }}
FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
ci:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15.7
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: echo-web
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install

- run: pnpm db:migrate

- name: Install playwright browsers
run: pnpm --filter=playwright test:install

- name: Seed database
run: pnpm seed database --mode test

- name: Build
run: pnpm build

- name: Run unit tests
run: pnpm test:unit

- name: Run playwright tests
run: pnpm test:e2e

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright/playwright-report/
retention-days: 30

0 comments on commit 749ddc4

Please sign in to comment.