name: CI on: push: branches: [main] pull_request: env: DOTNET_CLI_TELEMETRY_OPTOUT: "1" DOTNET_NOLOGO: "1" jobs: build: name: Build og unit tests # "docker" er standard-label for en Forgejo runner. Ret til jeres runners label, hvis det er et andet. runs-on: docker container: image: mcr.microsoft.com/dotnet/sdk:10.0 steps: - name: Checkout run: | git init -q . git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" git -c http.extraHeader="Authorization: token ${{ secrets.GITHUB_TOKEN }}" fetch -q --depth 1 origin "${{ github.sha }}" git checkout -q FETCH_HEAD - name: Restore run: dotnet restore - name: Build run: dotnet build --no-restore --configuration Release - name: Unit tests run: dotnet test --no-build --configuration Release --filter "Category!=Integration" integration: name: Integration (${{ matrix.image }}) needs: build # Kræver en runner, der har adgang til Docker (Testcontainers starter SQL Server-containere). # Slå til ved at sætte repo-variablen RUN_INTEGRATION_TESTS=true og give runneren labelen "docker-host". if: ${{ vars.RUN_INTEGRATION_TESTS == 'true' }} runs-on: docker-host strategy: fail-fast: false matrix: image: - mcr.microsoft.com/mssql/server:2017-latest - mcr.microsoft.com/mssql/server:2019-latest - mcr.microsoft.com/mssql/server:2022-latest - mcr.microsoft.com/mssql/server:2025-latest env: SQLINSIGHT_MSSQL_IMAGE: ${{ matrix.image }} steps: - name: Checkout run: | git init -q . git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" git -c http.extraHeader="Authorization: token ${{ secrets.GITHUB_TOKEN }}" fetch -q --depth 1 origin "${{ github.sha }}" git checkout -q FETCH_HEAD - name: Integration tests run: dotnet test tests/SQLInsight.IntegrationTests --configuration Release