From 7584ba3e7d9abbf64253640c28867aabd89015a6 Mon Sep 17 00:00:00 2001 From: Roman Dyakov Date: Sat, 6 Apr 2024 16:21:29 +0300 Subject: [PATCH] Service instead docker setup --- .github/workflows/checks.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9a04895..55606cb 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -7,14 +7,20 @@ jobs: test: name: Unit tests runs-on: ubuntu-latest + services: + postgres: + image: postgres:15 + env: + POSTGRES_HOST_AUTH_METHOD: trust + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + -p 5432:5432 steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up docker - uses: docker-practice/actions-setup-docker@master - - name: Run postgres - run: | - docker run -d -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust --name db-test postgres:15-alpine - uses: actions/setup-python@v4 with: python-version: "3.11" @@ -30,6 +36,7 @@ jobs: id: pytest run: | DB_DSN=postgresql://postgres@localhost:5432/postgres pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=calendar_backend tests/ | tee pytest-coverage.txt + exit ${PIPESTATUS[0]} - name: Print report if: always() run: |