Skip to content

Commit

Permalink
temporarily add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rm03 committed Feb 18, 2024
1 parent 682b1d6 commit d8fe2fd
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,52 @@ jobs:
path: /tmp/image.tar
needs: frontend-check

integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: Load docker images
run: |-
docker load --input build-backend/image.tar
docker load --input build-frontend/image.tar
- name: Run docker compose
run: |-
mkdir -p /tmp/test-results
docker-compose -f docker-compose.test.yaml up -d
- name: Wait for backend
run: |-
for try in {1..20}; do
docker-compose -f docker-compose.test.yaml exec -T backend python manage.py migrate --check && break
sleep 5
done
- name: Populate backend
run: docker-compose -f docker-compose.test.yaml exec -T backend python manage.py populate
- name: Run integration tests
run: docker-compose -f docker-compose.test.yaml exec -T frontend yarn integration
- name: Delete artifacts when no longer needed
if: failure() || github.ref != 'refs/heads/master'
uses: geekyeggo/delete-artifact@v1
with:
name: |-
build-backend
build-frontend
- name: Print logs on failure
if: failure()
run: docker-compose -f docker-compose.test.yaml logs
- name: Upload artifacts on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: cypress-output
path: /tmp/test-results
env:
GIT_SHA: ${{ github.sha }}
needs:
- build-backend
- build-frontend

publish:
name: Publish Images
runs-on: ubuntu-latest
Expand All @@ -103,9 +149,9 @@ jobs:
run: |-
docker push -a pennlabs/penn-clubs-backend
docker push -a pennlabs/penn-clubs-frontend
needs:
- build-backend
- build-frontend
needs: integration-tests
# - build-backend
# - build-frontend

deploy:
name: "Deploy"
Expand Down

0 comments on commit d8fe2fd

Please sign in to comment.