Skip to content

Integration Tests

Integration Tests #466

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