name: CI on: push: branches: [main] tags: ["v*"] pull_request: jobs: build: name: Build og unit tests # Self-hosted appserver-runner (host-mode). Selve bygget kører i SDK-imaget via deploy/ci/Dockerfile. runs-on: [self-hosted, appserver] timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v4 - name: Restore, build og unit tests run: docker build --progress=plain -f deploy/ci/Dockerfile --target test -t "sqlinsight-ci:${{ github.sha }}" . - name: Ryd op if: always() run: docker image rm "sqlinsight-ci:${{ github.sha }}" 2>/dev/null || true msi: name: MSI-installer needs: build runs-on: [self-hosted, appserver] timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v4 - 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 docker buildx build --progress=plain -f deploy/ci/Dockerfile --target msi --build-arg VERSION="$version" --output type=local,dest=dist . ls -l dist/*.msi - 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