Skip to content

Commit

Permalink
Merge pull request #9 from fumeapp/try-bg-run
Browse files Browse the repository at this point in the history
🧪 alright lets see what happens here
  • Loading branch information
acidjazz authored Aug 24, 2024
2 parents 1d6e98b + 30637ae commit 5fab08c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Run Tests
on:
pull_request

env:
DEVRUN: true
jobs:
test:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -50,22 +52,29 @@ jobs:
- name: Generate Prisma deps
run: npx prisma generate

- name: Copy .env.test-action to .env.test
run: cp .env.test-action .env.test

- name: Build
env:
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }}
run: pnpm run build

- name: Rename .env.test-action to .env.test
run: mv .env.test-action .env.test
- name: Start Server
run: pnpm run dev:test &

- name: Run Migrations
run: pnpm run db:test:reset

- name: Sleep for 10 seconds
run: sleep 10

- name: Run Vitest
env:
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }}
NODE_ENV: test
run: pnpm run test:coverage
run: pnpm run test:dev:coverage

- name: Report Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test:dev:reset": "pnpm run db:test:reset; DEVRUN=true vitest run",
"db:test:reset": "dotenv -e .env.test -- npx prisma migrate reset --force",
"test:coverage": "vitest run --coverage.enabled true",
"test:dev:coverage": "DEVRUN=true vitest run --coverage.enabled true",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:action": "pnpm run lint -f @jamesacarr/github-actions"
Expand Down
5 changes: 1 addition & 4 deletions test/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
function setupConfig() {
if (process.env.DEVRUN === 'true' && !process.env.CI)
return { host: 'http://localhost:3000' }
else
return {}
return { host: 'http://[::]:3000' }
}

export {
Expand Down

0 comments on commit 5fab08c

Please sign in to comment.