parent
2432aa587b
commit
833ca83a61
@ -2,6 +2,12 @@ name: Unit tests
|
|||||||
run-name: ${{ gitea.actor }} is testing
|
run-name: ${{ gitea.actor }} is testing
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
|
env:
|
||||||
|
POSTGRES_HOST: persistence-cicd-test-postgres-db
|
||||||
|
POSTGRES_PORT: 5442
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -13,22 +19,22 @@ jobs:
|
|||||||
# Docker Hub image
|
# Docker Hub image
|
||||||
image: postgres
|
image: postgres
|
||||||
# Provide the password for postgres
|
# Provide the password for postgres
|
||||||
|
hostname: ${{ env.POSTGRES_HOST }}
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: ${{ env.POSTGRES_USER }}
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
|
||||||
# Set health checks to wait until postgres has started
|
# Set health checks to wait until postgres has started
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd pg_isready
|
--health-cmd pg_isready
|
||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
ports:
|
ports:
|
||||||
# Maps tcp port 5432 on service container to the host
|
# Maps tcp port 5432 on service container to the host
|
||||||
- 5442:5432
|
- '${{ env.POSTGRES_PORT }}:5432'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
|
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.0.x
|
dotnet-version: 8.0.x
|
||||||
@ -36,6 +42,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
env:
|
env:
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: ${{ env.POSTGRES_HOST }}
|
||||||
POSTGRES_PORT: ${{ job.services.postgres.ports[5442] }}
|
POSTGRES_PORT: ${{ env.POSTGRES_PORT }}
|
||||||
run: dotnet test DD.Persistence.IntegrationTests
|
run: dotnet test DD.Persistence.IntegrationTests
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"DbConnection": {
|
"DbConnection": {
|
||||||
"Host": "postgres",
|
"Host": "persistence-cicd-test-postgres-db",
|
||||||
"Port": 5442,
|
"Port": 5442,
|
||||||
"Username": "postgres",
|
"Username": "postgres",
|
||||||
"Password": "postgres"
|
"Password": "postgres"
|
||||||
|
Loading…
Reference in New Issue
Block a user