diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 03293ae6..e097f3c1 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -60,11 +60,14 @@ jobs: - name: Build docker compose run: make build_dev - - name: Run Unit Tests - run: make unit_test + - name: Run Tests + run: make test - - name: Run Integration Tests - run: make integration_test + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: code-coverage-report + path: htmlcov build: if: | diff --git a/Makefile b/Makefile index 472229e3..bcfe5f2b 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +MIN_COVERAGE = 60 + bootstrap: - pyenv deactivate pyenv virtualenv 3.9 admin-backend @@ -30,13 +32,13 @@ build_dev: docker compose build unit_test: build - docker compose run --rm navigator-admin-backend pytest -vvv tests/unit_tests --cov=app --cov-fail-under=80 --cov-report=term --cov-report=html + docker compose run --rm navigator-admin-backend pytest -vvv tests/unit_tests --cov=app --cov-fail-under=$(MIN_COVERAGE) --cov-report=term --cov-report=html integration_test: build_dev - docker compose run --rm navigator-admin-backend pytest -vvv tests/integration_tests --cov=app --cov-fail-under=80 --cov-report=term --cov-report=html + docker compose run --rm navigator-admin-backend pytest -vvv tests/integration_tests --cov=app --cov-fail-under=$(MIN_COVERAGE) --cov-report=term --cov-report=html test: build_dev - docker compose run --rm navigator-admin-backend -- pytest -vvv tests --cov=app --cov-fail-under=80 --cov-report=term --cov-report=html + docker compose run --rm navigator-admin-backend -- pytest -vvv tests --cov=app --cov-fail-under=$(MIN_COVERAGE) --cov-report=term --cov-report=html run: docker compose -f docker-compose.yml up -d --remove-orphans