persistence/.gitea/workflows/test.yaml
Olga Nemt a51f6e1b3b
Some checks failed
Unit tests / test (push) Failing after 1m56s
правка
2024-12-18 10:39:56 +05:00

49 lines
1.4 KiB
YAML

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
# 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 }}
POSTGRES_HOST: ${{ env.POSTGRES_HOST }}
# 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: ${{ env.POSTGRES_HOST }}
POSTGRES_PORT: ${{ env.POSTGRES_PORT }}
run: dotnet test DD.Persistence.IntegrationTests