-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (35 loc) · 1.47 KB
/
integration-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Integration Tests
on:
push:
env:
JWT_SECRET: ${{secrets.JWT_SECRET}}
CORS_ALLOW_ORIGIN: ${{vars.CORS_ALLOW_ORIGIN}}
DB_URL: ${{vars.DB_URL}}
ENVIRONMENT: ${{vars.ENVIRONMENT}}
GET_WEEKLY_MEETINGS_JW_API: ${{vars.GET_WEEKLY_MEETINGS_JW_API}}
GEOCODING_API_KEY: ${{secrets.GEOCODING_API_KEY}}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare .env.secret file
run: |
cd backend/
echo "JWT_SECRET=${{secrets.JWT_SECRET}}" >> .env.secret
echo "CORS_ALLOW_ORIGIN=${{vars.CORS_ALLOW_ORIGIN}}" >> .env.secret
echo "DB_URL=${{vars.DB_URL}}" >> .env.secret
echo "ENVIRONMENT=${{vars.ENVIRONMENT}}" >> .env.secret
echo "GET_WEEKLY_MEETINGS_JW_API=${{vars.GET_WEEKLY_MEETINGS_JW_API}}" >> .env.secret
echo "GEOCODING_API_KEY=${{secrets.GEOCODING_API_KEY}}" >> .env.secret
- name: Build and Run Services
run: |
docker compose -f docker-compose.yml -f docker-compose.test.yml build
docker compose -f docker-compose.yml up -d
- name: Run Integration Tests
run: docker compose -f docker-compose.yml -f docker-compose.test.yml run --rm integration-test
- name: Services Teardown
# even if the checks fail, we still want to teardown the container.
if: always()
run: docker compose -f docker-compose.yml -f docker-compose.test.yml down