Skip to content

Commit e18a970

Browse files
fix tests in CI
1 parent 18ebce8 commit e18a970

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

.env.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
PORT=3000
2+
NODE_ENV=test
3+
PGHOST=db
4+
PGUSER=postgres
5+
PGPASSWORD=testpassword
6+
PGDATABASE=safeskiesdb
7+
PGPORT=5432
8+
JWT_SECRET=test-jwt-secret
9+
CLIENT_URL=http://localhost:3000
10+
BASE_URL=http://localhost:3000
11+
MUTE_LIST_URI=test-uri
12+
MUTE_LIST_ADMIN_DID=test-did
13+
BSKY_BASE_API_URL=https://bsky.social
14+
RSKY_FEEDGEN=http://localhost:8080
15+
RSKY_API_KEY=test-key

.github/workflows/ci.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,8 @@ jobs:
3939
cache-from: type=gha
4040
cache-to: type=gha,mode=max
4141

42-
- name: Create test docker-compose override
43-
run: |
44-
cat > docker-compose.test.yml << EOF
45-
services:
46-
backend:
47-
image: safe-skies-api:test
48-
EOF
42+
- name: Setup test environment
43+
run: cp .env.test .env
4944

5045
- name: Start test environment with built image
5146
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up -d
@@ -55,8 +50,4 @@ jobs:
5550

5651
- name: Stop test environment
5752
run: docker compose -f docker-compose.yml -f docker-compose.test.yml down
58-
if: always()
59-
60-
- name: Clean up test files
61-
run: rm -f docker-compose.test.yml
6253
if: always()

docker-compose.test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
backend:
3+
image: safe-skies-api:test
4+
env_file: .env.test
5+
db:
6+
environment:
7+
- POSTGRES_PASSWORD=testpassword

0 commit comments

Comments
 (0)