Files
pos-system/.github/workflows/ci-iam-service.yml
2026-02-23 12:20:33 +00:00

58 lines
1.8 KiB
YAML

name: IAM Service CI
on:
push:
paths:
- 'services/iam-service-net/**'
pull_request:
paths:
- 'services/iam-service-net/**'
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore API project
run: dotnet restore services/iam-service-net/src/IamService.API/IamService.API.csproj
- name: Build API project
run: dotnet build services/iam-service-net/src/IamService.API/IamService.API.csproj --configuration Release --no-restore
- name: Restore test projects
run: dotnet restore services/iam-service-net/tests/IamService.UnitTests/IamService.UnitTests.csproj && dotnet restore services/iam-service-net/tests/IamService.FunctionalTests/IamService.FunctionalTests.csproj
- name: Run unit tests
run: dotnet test services/iam-service-net/tests/IamService.UnitTests/IamService.UnitTests.csproj --configuration Release --no-restore --verbosity normal
- name: Run functional tests
run: dotnet test services/iam-service-net/tests/IamService.FunctionalTests/IamService.FunctionalTests.csproj --configuration Release --no-restore --verbosity normal
env:
ConnectionStrings__DefaultConnection: Host=localhost;Port=5432;Database=test_db;Username=testuser;Password=testpass
ASPNETCORE_ENVIRONMENT: Testing