From 70bbb0f7448c7c184c3df10eecdc177bc5d2ac47 Mon Sep 17 00:00:00 2001 From: Wolkenfarmer Date: Sat, 16 Mar 2024 13:34:55 +0100 Subject: [PATCH] #77: add GitHub workflow ci-tests --- .github/workflows/ci-tests.yml | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/ci-tests.yml diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 00000000..3d476cd9 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,66 @@ +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 +