Skip to content

Commit

Permalink
ci: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexZeitler committed Apr 14, 2024
1 parent 67729ae commit 28589f5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: .NET Core Build with Tests

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

jobs:
build:
# use ubuntu for more build minutes
runs-on: ubuntu-latest
# use release mode for all steps
env:
config: 'Debug'

steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'

- name: Install dependencies
run: |
cd src
dotnet restore
- name: Build
run: |
cd src
dotnet build --configuration $config --no-restore
- name: Test
run: |
cd test-database
docker compose up -d
cd ..
cd src
dotnet test -l "console;verbosity=detailed"
4 changes: 2 additions & 2 deletions test-database/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: "3"

services:
test-database-1:
image: library/postgres:14
image: library/postgres:16
container_name: testdb-1
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: '123456'
POSTGRES_DB: 'postgres'
ports:
- "5435:5432"
- "5435:5432"

0 comments on commit 28589f5

Please sign in to comment.