sqlinsight-pro/.forgejo/workflows/ci.yml
Søren Eggert Lundsteen Olsen 3da6f338b7
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 57s
deploy community / deploy (push) Successful in 1s
CI / MSI-installer (push) Successful in 38s
Download the newest MSI with installer/get-latest-msi.ps1
Forgejo 10 has no releases/latest/download/ URL, so the versionless second
copy of the MSI in each release was useless. Releases now carry the MSI
once; get-latest-msi.ps1 finds it through GET /releases/latest (no login).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 07:35:49 +02:00

78 lines
3 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
- name: Udgiv som release
# Kun tags (v1.2.0): MSI'en vedhæftes releasen og kan hentes uden login, nyeste med
# installer/get-latest-msi.ps1. RELEASE_TOKEN (valgfri secret) bruges, hvis Actions' automatiske
# token ikke må oprette releases.
if: startsWith(github.ref, 'refs/tags/v')
env:
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
run: python3 installer/publish-release.py 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