test yeeet again #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI with Docker Compose | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: Dev | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Build | |
run: | | |
docker-compose -f docker-compose-dev-ga.yaml up --build -d | |
env: | |
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | |
FLASK_SECRET_KEY: ${{ secrets.FLASK_SECRET_KEY }} | |
DATABASE_USER: ${{ secrets.DATABASE_USER }} | |
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} | |
DATABASE_DB: ${{ secrets.DATABASE_DB }} | |
DATABASE_HOST: ${{ secrets.DATABASE_HOST }} | |
TEST_DATABASE_DB: ${{ secrets.TEST_DATABASE_DB }} | |
ENVIRONMENT: ${{ env.ENVIRONMENT }} | |
- name: Run Tests | |
run: | | |
docker-compose -f docker-compose-dev-ga.yaml exec commonplace-backend-1 pytest | |
docker-compose exec -T commonplace-backend-1 pip3 install pytest | |
docker-compose exec -T commonplace-backend-1 pytest | |
- name: Fetch container logs | |
if: always() | |
run: | | |
docker ps | |
docker logs commonplace-backend-1 | |
- name: Cleanup | |
if: always() | |
run: docker-compose -f docker-compose-dev-ga.yaml down |