#77: add GitHub workflow ci-tests #5
Workflow file for this run
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 Tests | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build-and-test-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build frontend Docker container | |
run: | | |
cd ./frontend/ | |
docker-compose up | |
build-and-test-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build backend Docker containers | |
run: | | |
cd ./backend/dps_training_k/ | |
docker pull redis:latest | |
docker-compose up | |
- name: Run backend tests | |
run: docker exec -it K-dPS-django python3 manage.py test | |
test-integration: | |
needs: [build-and-test-frontend, build-and-test-backend] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build frontend Docker container | |
run: | | |
cd ./frontend/ | |
docker-compose up | |
- name: Build backend Docker containers | |
run: | | |
cd ./backend/dps_training_k/ | |
docker pull redis:latest | |
docker-compose up | |
- name: Run integration tests | |
run: | | |
cd ./frontend/ | |
npm install cypress --save-dev | |
npx cypress run --e2e | |