Skip to content

Commit

Permalink
feat(ci): setup e2e tests in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-h1 committed Aug 11, 2024
1 parent e0bbe2c commit 670dd2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:

- name: ${{ inputs.environment }} UI tests
if: inputs.target == 'e2e-local'
run: ./scripts/setup-testdb.sh && pnpx start-server-and-test dev 8000 e2e:local
run: ./scripts/setup-e2edb.sh && pnpx start-server-and-test dev 8000 e2e:local
shell: bash

- name: ${{ inputs.environment }} UI tests
Expand Down
8 changes: 8 additions & 0 deletions scripts/setup-e2edb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

trap 'echo -e "\033[31m✖ An error occurred. Exiting...\033[0m"; exit 1;' ERR

DATABASE_URL='postgresql://pets:pets@localhost:5432/pets?schema=public' pnpm db:migrate-dev && DATABASE_URL='postgresql://pets:pets@localhost:5432/pets?schema=public' pnpm prisma db push
echo -e "\033[32m✔ Test Database migrated\033[0m"

0 comments on commit 670dd2d

Please sign in to comment.