Skip to content

Commit

Permalink
Add automated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zera1ul committed Sep 15, 2024
1 parent 475c053 commit 39ef71d
Show file tree
Hide file tree
Showing 9 changed files with 1,523 additions and 46 deletions.
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
PGADMIN_DEFAULT_EMAIL=[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

0 comments on commit 39ef71d

Please sign in to comment.