From a1fa5651c8615d7d965a9a80f0aeb93c4653da50 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Wed, 18 Dec 2024 11:20:57 +0500 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yaml | 84 +++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index b63cb81..e20ab9c 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -2,46 +2,62 @@ name: Unit tests run-name: ${{ gitea.actor }} is testing on: push -env: - POSTGRES_HOST: persistence-cicd-test-postgres-db - POSTGRES_PORT: 5442 - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - jobs: - test: + container-network-test: runs-on: ubuntu-latest - - # Service containers to run with `runner-job` services: - # Label used to access the service container postgres: - # Docker Hub image image: postgres - # Provide the password for postgres - # hostname: ${{ env.POSTGRES_HOST }} env: - POSTGRES_USER: ${{ env.POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + POSTGRES_DB: postgres ports: - # Maps tcp port 5432 on service container to the host - - '${{ env.POSTGRES_PORT }}:5432' - + - 5442:5432 + options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 steps: - - name: Setup dotnet - uses: actions/setup-dotnet@v4 + - uses: actions/checkout@v4 + - name: Run docker action and test network connection + uses: ./ with: - dotnet-version: 8.0.x - - name: Check out repository code - uses: actions/checkout@v4 - - name: Run integration tests - env: - POSTGRES_HOST: persistence-cicd-test-postgres-db - POSTGRES_PORT: ${{ env.POSTGRES_PORT }} - run: dotnet test DD.Persistence.IntegrationTests + image: postgres + run: > + pg_isready -d test -U test -h postgres -p 5442 + options: > + -e PGPASSWORD=postgres + # test: + # runs-on: ubuntu-latest + + # # Service containers to run with `runner-job` + # services: + # # Label used to access the service container + # postgres: + # # Docker Hub image + # image: postgres + # # Provide the password for postgres + # # hostname: ${{ env.POSTGRES_HOST }} + # env: + # POSTGRES_USER: ${{ env.POSTGRES_USER }} + # POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} + # # Set health checks to wait until postgres has started + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # ports: + # # Maps tcp port 5432 on service container to the host + # - '${{ env.POSTGRES_PORT }}:5432' + + # steps: + # - name: Setup dotnet + # uses: actions/setup-dotnet@v4 + # with: + # dotnet-version: 8.0.x + # - name: Check out repository code + # uses: actions/checkout@v4 + # - name: Run integration tests + # env: + # POSTGRES_HOST: persistence-cicd-test-postgres-db + # POSTGRES_PORT: ${{ env.POSTGRES_PORT }} + # run: dotnet test DD.Persistence.IntegrationTests