Skip to content

Commit

Permalink
Merge pull request #13 from fumeapp/build-tests
Browse files Browse the repository at this point in the history
💚 attempt to kill sleep and use build
  • Loading branch information
acidjazz authored Aug 25, 2024
2 parents 6251803 + 4c04f9d commit 2c319bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
Expand All @@ -41,26 +44,19 @@ jobs:
- name: Install Dependencies
run: pnpm i

- name: Generate Prisma deps
- name: Generate prisma deps
run: npx prisma generate

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

- name: Build
- name: Build and start server in the background
env:
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }}
run: pnpm run build

- name: Start Server
run: pnpm run dev:test &
run: pnpm run build:test:start:bg

- 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 }}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"private": true,
"scripts": {
"build": "nuxt build",
"build:test:start": "nuxt build --dotenv .env.test ; node --env-file=.env.test .output/server/index.mjs",
"build:test:start:bg": "nuxt build --dotenv .env.test ; node --env-file=.env.test .output/server/index.mjs &",
"dev": "nuxt dev",
"dev:test": "nuxt dev --dotenv .env.test",
"generate": "nuxt generate",
Expand Down

0 comments on commit 2c319bf

Please sign in to comment.