Files
Rbm.FamStack/.github/workflows/ci.yml
T
2026-10-09 18:25:11 +02:00

64 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore
run: dotnet restore FamilyPlanner.slnx
- name: Build (Warnungen sind Fehler)
run: dotnet build FamilyPlanner.slnx -c Release --no-restore
- name: Unit- und Komponententests
run: |
dotnet test --project tests/FamilyPlanner.UnitTests -c Release --no-build
dotnet test --project tests/FamilyPlanner.Web.Tests -c Release --no-build
- name: HTTPS-Entwicklungszertifikat (für Aspire-Integrationstests)
run: dotnet dev-certs https
- name: Integrationstests (Aspire + SQL-Server-Container)
run: dotnet test --project tests/FamilyPlanner.IntegrationTests -c Release --no-build
docker-images:
runs-on: ubuntu-latest
needs: build-and-test
strategy:
matrix:
project: [FamilyPlanner.Api, FamilyPlanner.Web, FamilyPlanner.MigrationService]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Image bauen
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
build-args: PROJECT=${{ matrix.project }}
push: false
tags: familyplanner/${{ matrix.project }}:ci
cache-from: type=gha,scope=${{ matrix.project }}
cache-to: type=gha,mode=max,scope=${{ matrix.project }}