Skip to content

Added wildcard for reports search #7

Added wildcard for reports search

Added wildcard for reports search #7

Workflow file for this run

name: API CI
on:
push:
branches: [ main, develop ]
paths:
- "**/*.sln"
- "**/*.csproj"
- "**/*.cs"
- ".github/workflows/api-ci.yml"
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: api-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
env:
API_BASE_URL: ${{ secrets.API_BASE_URL }}
API_KEY: ${{ secrets.API_KEY }}
API_KEY_HEADER: ${{ secrets.API_KEY_HEADER }}
API_LOGIN_PATH: ${{ secrets.API_LOGIN_PATH }}
API_USERNAME: ${{ secrets.API_USERNAME }}
API_PASSWORD: ${{ secrets.API_PASSWORD }}
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
cache: true
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --configuration Release --no-restore
- name: Test + Coverage + Threshold
run: |
dotnet test ./ApiTests.sln \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=cobertura \
/p:CoverletOutput=TestResults/coverage/ \
/p:Threshold=80 \
/p:ThresholdType=line \
/p:ThresholdStat=total
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Generate Coverage Report
run: |
export PATH="$PATH:~/.dotnet/tools"
reportgenerator \
-reports:"**/TestResults/coverage/coverage.cobertura.xml" \
-targetdir:"CoverageReport" \
-reporttypes:"HtmlInline_AzurePipelines;Cobertura"
- name: Upload Test Results (.trx)
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults/**/*.trx
if-no-files-found: warn
- name: Upload Coverage Report (HTML)
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: CoverageReport/**
if-no-files-found: warn