added '--file=' to secScan arg #5
This file contains hidden or 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
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # pull_request: | |
| # branches: | |
| # - main | |
| # schedule: | |
| # - cron: "0 10 * * *" # Run daily at 10:00 UTC | |
| # For manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| # Service container for PostgreSQL database til brug under tests | |
| postgres: | |
| image: postgres:15 # Matcher version fra docker-compose | |
| env: | |
| # Matcher miljøvariabler fra docker-compose for postgres service | |
| POSTGRES_USER: appuser | |
| POSTGRES_PASSWORD: secret | |
| POSTGRES_DB: messagesdb | |
| ports: | |
| # Gør den interne port 5432 tilgængelig på localhost:5432 for runneren | |
| - 5432:5432 | |
| # Valgfrit men anbefalet: Vent til databasen er klar | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| # Service container for RabbitMQ til brug under tests | |
| rabbitmq: | |
| image: rabbitmq:3-management # Matcher version fra docker-compose (eller brug :management for latest) | |
| env: | |
| # Standard guest/guest bruges implicit hvis disse udelades | |
| RABBITMQ_DEFAULT_USER: guest | |
| RABBITMQ_DEFAULT_PASS: guest | |
| ports: | |
| # Gør interne porte tilgængelige på localhost for runneren | |
| - 5672:5672 | |
| - 15672:15672 | |
| # Valgfrit men anbefalet: Vent til RabbitMQ er klar | |
| options: --health-cmd "rabbitmq-diagnostics -q check_running" --health-interval 10s --health-timeout 5s --health-retries 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" # Bruger nyeste .NET 8 SDK patch | |
| # Cache NuGet pakker for hurtigere builds | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| # Nøgle baseret på OS og hash af projektfiler, der påvirker restore | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}-${{ hashFiles('**/global.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore dependencies | |
| # Kører restore for hele solution/projekt-træet | |
| run: dotnet restore | |
| - name: Build the project | |
| # Bygger i Release config uden at restore igen | |
| run: dotnet build --no-restore --configuration Release | |
| # Verificer at publish virker (valgfrit skridt) | |
| # - name: Verify publish framework-dependent | |
| # run: dotnet publish ./MessageConsumer/MessageConsumer.csproj --configuration Release --output ./publish/consumer-fd --no-build | |
| # | |
| # - name: Verify publish self-contained linux | |
| # run: dotnet publish ./MessageConsumer/MessageConsumer.csproj --configuration Release --output ./publish/consumer-sc-linux --self-contained true -r linux-x64 --no-build |