spell correction #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: your-lab-dev-db | |
POSTGRES_USER: your-lab-dev | |
POSTGRES_PASSWORD: SuperSecurePassw0rd | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
# | |
# - name: Test | |
# run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" | |
# | |
# - name: Find coverage reports | |
# id: find-reports | |
# run: | | |
# echo "::set-output name=paths::$(find ${{ github.workspace }} -name "coverage.cobertura.xml")" | |
# | |
# - name: Send coverage-reports to Codacy | |
# uses: codacy/[email protected] | |
# with: | |
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
# coverage-reports: ${{ steps.find-reports.outputs.paths }} | |
- name: Configure PostgreSQL Credentials | |
run: | | |
echo "POSTGRES_HOST=localhost" >> $GITHUB_ENV | |
echo "POSTGRES_PORT=5432" >> $GITHUB_ENV | |
echo "POSTGRES_DB=your-lab-dev-db" >> $GITHUB_ENV | |
echo "POSTGRES_USER=your-lab-dev" >> $GITHUB_ENV | |
echo "POSTGRES_PASSWORD=SuperSecurePassw0rd" >> $GITHUB_ENV | |
- name: Run application | |
run: dotnet run --project /home/runner/work/Your-Lab/Your-Lab/API/API.csproj & | |
- name: Wait for application startup | |
run: sleep 30 | |
- name: ZAP Scan | |
uses: zaproxy/[email protected] | |
with: | |
#token: ${{ secrets.GITHUB_TOKEN }} | |
docker_name: 'ghcr.io/zaproxy/zaproxy:stable' | |
target: 'https://localhost:7129/' | |
cmd_options: '-a -f openapi' # Aggressive scanning enabled | |
- name: Stop application | |
run: pkill dotnet |