Skip to content

Bump the database-driver-dependencies group with 14 updates #4

Bump the database-driver-dependencies group with 14 updates

Bump the database-driver-dependencies group with 14 updates #4

Workflow file for this run

name: Pull Requests
on:
pull_request_target:
branches:
- '*'
push:
branches:
- 'main'
env:
solution: 'FluentMigrator.sln'
buildPlatform: 'Any CPU'
buildConfiguration: Release
jobs:
build:
name: Build & Test
runs-on: ${{ matrix.os }}
permissions:
checks: write
issues: write
pull-requests: write
strategy:
matrix:
include:
- os: windows-latest
dotnet-tfm: net48
- os: ubuntu-latest
dotnet-tfm: net8.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.1.0
with:
versionSpec: 6.3.x
- name: Execute GitVersion
uses: gittools/actions/gitversion/execute@v4.1.0
env:
BUILD_BUILDNUMBER: ${{ env.GitVersion.NuGetVersionV2 }}
with:
updateAssemblyInfo: false
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup .NET Framework 4.8 Developer Pack (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# Check registry for .NET Framework 4.8 (Release >= 528040 indicates 4.8)
try { $reg = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' -ErrorAction Stop; $release = $reg.Release } catch { $release = 0 }
if ($release -ge 528040) {
Write-Host ".NET Framework 4.8 or higher already installed (Release=$release). Skipping install."
exit 0
}
Write-Host "No .NET Framework 4.8 Developer Pack found (Release=$release). Installing..."
# Ensure TLS 1.2 for secure downloads
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Resolve the current Microsoft download link by scraping the official docs page
$downloadPage = 'https://learn.microsoft.com/en-us/dotnet/framework/install/dotnet-48'
Write-Host "Resolving installer URL from: $downloadPage"
try {
$page = (Invoke-WebRequest -Uri $downloadPage -ErrorAction Stop).Content
if ($page -match 'https://download\.visualstudio\.microsoft\.com/[^\s"''<>]+ndp48-devpack-enu\.exe') { $link = $Matches[0] }
} catch {
$link = $null
}
if (-not $link) {
throw "Failed to resolve download URL for ndp48-devpack-enu.exe from Microsoft documentation. Please update the workflow with a valid installer URL."
}
Write-Host "Resolved download URL: $link"
$installerPath = Join-Path $env:TEMP 'ndp48-devpack-enu.exe'
# Download with retries; prefer BITS when available
$maxAttempts = 5
for ($i = 1; $i -le $maxAttempts; $i++) {
try {
if (Get-Command Start-BitsTransfer -ErrorAction SilentlyContinue) {
Start-BitsTransfer -Source $link -Destination $installerPath -ErrorAction Stop
} else {
Invoke-WebRequest -Uri $link -OutFile $installerPath -UseBasicParsing -ErrorAction Stop
}
break
} catch {
Write-Warning "Download attempt $i failed: $($_.Exception.Message)"
if ($i -eq $maxAttempts) { throw "Failed to download .NET Framework 4.8 Developer Pack after $maxAttempts attempts." }
Start-Sleep -Seconds (15 * $i)
}
}
Write-Host "Running installer: $installerPath"
Start-Process -FilePath $installerPath -ArgumentList '/quiet','/norestart' -Wait -ErrorAction Stop
# Verify installation
try { $reg = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' -ErrorAction Stop; $newRelease = $reg.Release } catch { $newRelease = 0 }
if ($newRelease -ge 528040) {
Write-Host ".NET Framework 4.8 Developer Pack installed (Release=$newRelease)."
} else {
throw ".NET Framework 4.8 installation completed but registry Release value is $newRelease."
}
# Cleanup
if (Test-Path $installerPath) { Remove-Item $installerPath -Force -ErrorAction SilentlyContinue }
- name: Restore, Build, Test
run: dotnet test --framework ${{ matrix.dotnet-tfm }} --configuration ${{ env.buildConfiguration }} --verbosity quiet --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-${{ matrix.dotnet-tfm }}"
env:
# Enable containers for integration tests only on Linux
FM_TestConnectionStrings__MySql__ContainerEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__MySql__IsEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__Oracle__ContainerEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__Oracle__IsEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__Postgres__ContainerEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__Postgres__IsEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__SqlServer2016__ContainerEnabled: ${{ matrix.os == 'ubuntu-latest' }}
FM_TestConnectionStrings__SqlServer2016__IsEnabled: ${{ matrix.os == 'ubuntu-latest' }}
- name: Combine Coverage Reports
uses: danielpalme/ReportGenerator-GitHub-Action@v5.5.0
if: '!cancelled()'
with:
reports: "**/*.cobertura.xml"
targetdir: "${{ github.workspace }}"
reporttypes: "Cobertura"
verbosity: "Info"
title: "Code Coverage"
tag: "${{ github.run_number }}_${{ github.run_id }}"
toolpath: "reportgeneratortool"
- name: Upload Combined Coverage XML
uses: actions/upload-artifact@v4
if: '!cancelled()'
with:
name: coverage-${{ matrix.os }}-${{ matrix.dotnet-tfm }}
path: ${{ github.workspace }}/Cobertura.xml
retention-days: 5
- name: Publish Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
if: matrix.os == 'ubuntu-latest' && (!cancelled())
with:
filename: "Cobertura.xml"
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "10 30"
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Upload Test Result Files
uses: actions/upload-artifact@v4
if: '!cancelled()'
with:
name: test-results-${{ matrix.os }}-${{ matrix.dotnet-tfm }}
path: ${{ github.workspace }}/**/TestResults-${{ matrix.dotnet-tfm }}/**/*
retention-days: 5
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
# GitHub Actions initially only supported containerized actions, which is not supported on Windows
# and this particular GitHub action from EnricoMi is a containerized action
if: matrix.os == 'ubuntu-latest' && (!cancelled())
with:
files: "${{ github.workspace }}/**/*.trx"
- name: Diagnostics (Linux)
if: matrix.os == 'ubuntu-latest' && failure()
run: |
echo "=== dotnet --info ==="
dotnet --info || true
echo "=== Repo root listing ==="
ls -la || true
echo "=== Check test project obj folder ==="
TEST_OBJ="test/FluentMigrator.Analyzers.Tests/obj"
if [ -d "$TEST_OBJ" ]; then
echo "Found $TEST_OBJ, listing contents (first 1000 chars of each file):"
find "$TEST_OBJ" -type f -maxdepth 3 -print -exec sh -c 'echo "---- {} ----"; head -c 1000 "{}" || true; echo' \;
else
echo "$TEST_OBJ does not exist"
fi
- name: Diagnostics (Windows)
if: matrix.os == 'windows-latest' && failure()
shell: pwsh
run: |
Write-Host "=== dotnet --info ==="
dotnet --info
Write-Host "=== Repo root listing ==="
Get-ChildItem -Force
$testObj = "test\FluentMigrator.Analyzers.Tests\obj"
Write-Host "=== Check test project obj folder ($testObj) ==="
if (Test-Path $testObj) {
Get-ChildItem -Path $testObj -Recurse -File | ForEach-Object {
$file = $_.FullName
Write-Host "---- $file ----"
try {
# Output the first 1000 lines
Get-Content -Path $file -TotalCount 1000
}
catch {
Write-Warning "Unable to read '$file': $($_.Exception.Message)"
}
Write-Host ""
}
} else {
Write-Host "$testObj does not exist"
}