правка
Some checks failed
Unit tests / test (push) Failing after 1m30s

This commit is contained in:
Olga Nemt 2024-12-18 10:35:12 +05:00
parent 2432aa587b
commit 833ca83a61
2 changed files with 15 additions and 9 deletions

View File

@ -2,6 +2,12 @@ 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:
runs-on: ubuntu-latest
@ -13,22 +19,22 @@ jobs:
# Docker Hub image
image: postgres
# Provide the password for postgres
hostname: ${{ env.POSTGRES_HOST }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
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
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5442:5432
- '${{ env.POSTGRES_PORT }}:5432'
steps:
- name: Setup dotnet
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
@ -36,6 +42,6 @@ jobs:
uses: actions/checkout@v4
- name: Run integration tests
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5442] }}
run: dotnet test DD.Persistence.IntegrationTests
POSTGRES_HOST: ${{ env.POSTGRES_HOST }}
POSTGRES_PORT: ${{ env.POSTGRES_PORT }}
run: dotnet test DD.Persistence.IntegrationTests

View File

@ -1,6 +1,6 @@
{
"DbConnection": {
"Host": "postgres",
"Host": "persistence-cicd-test-postgres-db",
"Port": 5442,
"Username": "postgres",
"Password": "postgres"