Skip to content

refactor: update rate limiting for authentication endpoints #64

refactor: update rate limiting for authentication endpoints

refactor: update rate limiting for authentication endpoints #64

Workflow file for this run

name: Backend CI
on:
push:
branches: [ main, feature/backend ]
paths:
- 'WebAPI/**'
- '.github/workflows/backend.yml'
- 'src/backend/**'
- '**/*.csproj'
- '**/*.sln'
pull_request:
branches: [ main ]
paths:
- 'WebAPI/**'
- '.github/workflows/backend.yml'
- 'src/backend/**'
- '**/*.csproj'
- '**/*.sln'
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('WebAPI/API.Alimed/API.Alimed.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
working-directory: WebAPI
run: dotnet restore API.Alimed/API.Alimed.csproj && dotnet restore API.Alimed.Tests/API.Alimed.Tests.csproj
- name: Build
working-directory: WebAPI
run: dotnet build API.Alimed/API.Alimed.csproj --configuration Release --no-restore
- name: Build Tests
working-directory: WebAPI
run: dotnet build API.Alimed.Tests/API.Alimed.Tests.csproj --configuration Release --no-restore
- name: Copy deps.json to test output
working-directory: WebAPI
run: |
set -e
SRC_DIR="API.Alimed/bin/Release/net9.0"
DST_DIR="API.Alimed.Tests/bin/Release/net9.0"
mkdir -p "$DST_DIR"
cp "$SRC_DIR"/*.deps.json "$DST_DIR"/ || true
- name: Ensure testhost.deps.json exists
working-directory: WebAPI
run: |
DST_DIR="API.Alimed.Tests/bin/Release/net9.0"
if [ ! -f "$DST_DIR/testhost.deps.json" ]; then
if [ -f "$DST_DIR/API.Alimed.deps.json" ]; then
cp "$DST_DIR/API.Alimed.deps.json" "$DST_DIR/testhost.deps.json"
fi
fi
- name: Run tests
working-directory: WebAPI/API.Alimed.Tests
run: dotnet test --configuration Release --verbosity normal
- name: Publish
working-directory: WebAPI
run: dotnet publish API.Alimed/API.Alimed.csproj -c Release -o ./publish
- name: Upload publish artifact
uses: actions/upload-artifact@v4
with:
name: backend-publish
path: WebAPI/publish/