sqlinsight-pro/.forgejo/workflows/ci.yml
Søren Eggert Lundsteen Olsen 4fdeff87fa
Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Successful in 1m10s
deploy hub / deploy (push) Successful in 19s
CI / MSI-installer (push) Successful in 50s
Deploy hub to SEOSoft appserver; run CI on the self-hosted runner
deploy-hub.yml builds deploy/hub/Dockerfile on the appserver runner, writes
.env from repo secrets and starts docker-compose.prod.yml (external
PostgreSQL, /data bind-mounted), then polls /health.

ci.yml used runs-on: docker, which no runner has, so jobs never started.
Build/tests and the MSI now run inside the SDK image via deploy/ci/Dockerfile,
because the host-mode runner ignores container: and has no apt-get.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 15:37:56 +02:00

70 lines
2.6 KiB
YAML

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|.*<Version>\(.*\)</Version>.*|\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