Skip to content

Bump Microsoft.AspNetCore.Authentication.JwtBearer and 6 others #394

Bump Microsoft.AspNetCore.Authentication.JwtBearer and 6 others

Bump Microsoft.AspNetCore.Authentication.JwtBearer and 6 others #394

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, master]
workflow_call:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: Backend Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore PropertyManager.sln
- name: Build solution
run: dotnet build PropertyManager.sln --no-restore --configuration Release
- name: Run tests
run: dotnet test PropertyManager.sln --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage"
- name: Upload test results
uses: actions/upload-artifact@v7
if: always()
with:
name: backend-test-results
path: backend/**/TestResults/**/*.trx
frontend:
name: Frontend Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Run tests
run: npm test
docker:
name: Docker Build Verification
runs-on: ubuntu-latest
needs: [backend, frontend]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build backend Docker image
uses: docker/build-push-action@v6
with:
context: ./backend
push: false
tags: property-manager-api:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build frontend Docker image
uses: docker/build-push-action@v6
with:
context: ./frontend
push: false
tags: property-manager-web:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: [backend, frontend]
services:
db:
image: postgres:16
env:
POSTGRES_DB: propertymanager
POSTGRES_PASSWORD: localdev
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mailhog:
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Restore backend dependencies
working-directory: backend
run: dotnet restore PropertyManager.sln
- name: Build backend
working-directory: backend
run: dotnet build PropertyManager.sln --no-restore --configuration Release
- name: Install EF Core tools
run: dotnet tool install --global dotnet-ef
- name: Apply database migrations
working-directory: backend
env:
ConnectionStrings__Default: Host=localhost;Database=propertymanager;Username=postgres;Password=localdev
run: dotnet ef database update --project src/PropertyManager.Infrastructure --startup-project src/PropertyManager.Api --no-build --configuration Release
- name: Start backend API
working-directory: backend
env:
ConnectionStrings__Default: Host=localhost;Database=propertymanager;Username=postgres;Password=localdev
Jwt__Secret: local-e2e-test-secret-key-min-32-chars
Jwt__Issuer: http://localhost:5292
Jwt__Audience: http://localhost:4200
Email__Provider: Smtp
Email__SmtpHost: localhost
Email__SmtpPort: 1025
Email__FromAddress: noreply@test.com
ASPNETCORE_ENVIRONMENT: Development
ASPNETCORE_URLS: http://localhost:5292
RateLimiting__Disabled: "true"
run: |
dotnet run --project src/PropertyManager.Api --no-build --configuration Release &
sleep 10
for i in {1..30}; do
if curl -s http://localhost:5292/api/v1/health > /dev/null; then
echo "API is ready"
break
fi
echo "Waiting for API... ($i)"
sleep 2
done
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright browsers
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Start frontend dev server
working-directory: frontend
run: |
npm run start &
sleep 10
for i in {1..30}; do
if curl -s http://localhost:4200 > /dev/null; then
echo "Frontend is ready"
break
fi
echo "Waiting for frontend... ($i)"
sleep 2
done
- name: Run E2E tests
working-directory: frontend
env:
BASE_URL: http://localhost:4200
MAILHOG_URL: http://localhost:8025
CI: true
run: npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 7
- name: Upload test traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces
path: frontend/test-results/
retention-days: 7