name: CI on: push: branches: [main] tags: ["v*"] 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" msi: name: MSI-installer needs: build 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: Værktøjer (wixl, msitools; nodejs til upload-artifact) run: apt-get update -q && apt-get install -y -q --no-install-recommends wixl msitools python3 nodejs - name: Byg og kontrollér MSI # Et tag som v1.2.0 giver version 1.2.0; ellers versionen fra Directory.Build.props. run: | version="${GITHUB_REF_NAME#v}" case "$GITHUB_REF" in refs/tags/v*) ;; *) version=$(sed -n 's|.*\(.*\).*|\1|p' Directory.Build.props) ;; esac installer/build-msi.sh "$version" - name: Gem MSI uses: https://code.forgejo.org/actions/upload-artifact@v3 with: name: SQLInsight-Pro-msi path: dist/*.msi 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