Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated tests #10

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_HOST=localhost
POSTGRES_DB=badgehub
POSTGRES_USER=badgehub
POSTGRES_PASSWORD=badgehub
PGADMIN_DEFAULT_PASSWORD=badgehub
[email protected]
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ jobs:
- name: Run build
run: |
npm run build
- name: Start environment
run: |
docker compose -f compose.test.yml up -d --wait
- name: Run test
run: |
npm run test
13 changes: 13 additions & 0 deletions compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
db:
image: postgres:16
env_file:
- .env.test
ports:
- 5432:5432
volumes:
- ./mockup-data.sql:/docker-entrypoint-initdb.d/data.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
retries: 30
Loading