Skip to content

Commit

Permalink
Update dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-javid committed Sep 19, 2024
1 parent b116d8d commit 7fa6a37
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
name: Test Suite
name: .NET

on:
push:
branches: ["*"]
branches: [ "*" ]
pull_request:
branches: ["main"]
branches: [ "main" ]

jobs:
tests:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U myuser"
--health-interval=10s
--health-timeout=5s
--health-retries=5
- name: Docker Compose Up
run: docker compose --verbose -f docker-compose.tests.yml up -d --build
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
env:
ConnectionStrings__Default: "Host=localhost;Port=5432;Username=myuser;Password=mypassword;Database=mydatabase;"
ConnectionStrings__Jobs: "Host=localhost;Port=5432;Username=myuser;Password=mypassword;Database=mydatabase;"
Serilog__WriteTo__0__Args__connectionString: "Host=localhost;Port=5432;Username=myuser;Password=mypassword;Database=mydatabase;"
Serilog__WriteTo__0__Name: "PostgreSQL"
Serilog__WriteTo__0__Args__tableName: "log_table"
run: dotnet test --no-build --verbosity detailed

0 comments on commit 7fa6a37

Please sign in to comment.