diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7de7a822a..5f529b548 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,23 +7,25 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 jobs: - ci: + build: runs-on: windows-2025 - strategy: - fail-fast: false - matrix: - FIREBIRD_SELECTION: [FB30, FB40, FB50] - TEST_SUITE: [Tests-FirebirdClient-Default-Compression-CryptRequired, Tests-FirebirdClient-Default-NoCompression-CryptRequired, Tests-FirebirdClient-Default-Compression-CryptDisabled, Tests-FirebirdClient-Default-NoCompression-CryptDisabled, Tests-FirebirdClient-Embedded, Tests-EFCore, Tests-EFCore-Functional, Tests-EF6] - timeout-minutes: 120 + timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v5 - + - name: .NET 10.0 uses: actions/setup-dotnet@v5 with: dotnet-version: 10.0.x + - name: NuGet Cache + uses: actions/cache@v5 + with: + path: ~/.nuget/packages + key: nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props', '**/Versions.props') }} + restore-keys: nuget- + - name: Build run: | try { @@ -36,6 +38,63 @@ jobs: } shell: powershell + - name: Upload Build Output + uses: actions/upload-artifact@v7 + with: + name: build-output + path: '.\\out\\' + + - name: Upload Test Binaries + uses: actions/upload-artifact@v7 + with: + name: test-binaries + path: '.\\src\\**\\bin\\' + + test: + needs: build + runs-on: windows-2025 + strategy: + fail-fast: false + matrix: + include: + # Full coverage on FB50 (latest) + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-FirebirdClient-Default-Compression-CryptRequired } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-FirebirdClient-Default-NoCompression-CryptRequired } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-FirebirdClient-Default-Compression-CryptDisabled } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-FirebirdClient-Default-NoCompression-CryptDisabled } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-FirebirdClient-Embedded } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-EFCore } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-EFCore-Functional } + - { FIREBIRD_SELECTION: FB50, TEST_SUITE: Tests-EF6 } + # Compatibility check on FB40 + - { FIREBIRD_SELECTION: FB40, TEST_SUITE: Tests-FirebirdClient-All } + - { FIREBIRD_SELECTION: FB40, TEST_SUITE: Tests-EFCore } + - { FIREBIRD_SELECTION: FB40, TEST_SUITE: Tests-EF6 } + # Compatibility check on FB30 + - { FIREBIRD_SELECTION: FB30, TEST_SUITE: Tests-FirebirdClient-All } + - { FIREBIRD_SELECTION: FB30, TEST_SUITE: Tests-EFCore } + timeout-minutes: 120 + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: .NET 10.0 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x + + - name: Download Test Binaries + uses: actions/download-artifact@v8 + with: + name: test-binaries + path: '.\\src\\' + + - name: Firebird Cache + uses: actions/cache@v5 + with: + path: 'C:\firebird' + key: firebird-${{ matrix.FIREBIRD_SELECTION }} + - name: Tests run: | try { @@ -49,9 +108,3 @@ jobs: exit 1 } shell: powershell - - - name: Publish Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'ci_${{ matrix.TEST_SUITE }}_${{ matrix.FIREBIRD_SELECTION }}_${{ env.CONFIGURATION }}' - path: '.\\out\\' diff --git a/build.ps1 b/build.ps1 index 308363e27..9f00025ea 100644 --- a/build.ps1 +++ b/build.ps1 @@ -20,7 +20,6 @@ function Clean() { } function Build() { - dotnet clean "$baseDir\src\NETProvider.slnx" -c $Configuration -v m dotnet build "$baseDir\src\NETProvider.slnx" -c $Configuration -p:ContinuousIntegrationBuild=true -v m } diff --git a/tests.ps1 b/tests.ps1 index 6af9ac102..a852d5014 100644 --- a/tests.ps1 +++ b/tests.ps1 @@ -47,21 +47,36 @@ function Prepare() { $selectedConfiguration = $FirebirdConfiguration[$FirebirdSelection] $fbDownload = $selectedConfiguration.Download $fbDownloadName = $fbDownload -Replace '.+/(.+)$','$1' - if (Test-Path $firebirdDir) { - rm -Force -Recurse $firebirdDir + + if (Test-Path "$firebirdDir\firebird.exe") { + echo "Using cached Firebird from $firebirdDir" + } + else { + if (Test-Path $firebirdDir) { + rm -Force -Recurse $firebirdDir + } + mkdir $firebirdDir | Out-Null + + pushd $firebirdDir + try { + echo "Downloading $fbDownload" + Invoke-RestMethod -Uri $fbDownload -OutFile $fbDownloadName + echo "Extracting $fbDownloadName" + 7z x -bsp0 -bso0 $fbDownloadName + rm $fbDownloadName + } + finally { + popd + } } - mkdir $firebirdDir | Out-Null + + cp -Recurse -Force $firebirdDir\* $testsProviderDir pushd $firebirdDir try { - echo "Downloading $fbDownload" - Invoke-RestMethod -Uri $fbDownload -OutFile $fbDownloadName - echo "Extracting $fbDownloadName" - 7z x -bsp0 -bso0 $fbDownloadName - rm $fbDownloadName - cp -Recurse -Force .\* $testsProviderDir - - ni firebird.log -ItemType File | Out-Null + if (-not (Test-Path firebird.log)) { + ni firebird.log -ItemType File | Out-Null + } echo "Starting Firebird" $process = Start-Process -FilePath $selectedConfiguration.Executable -ArgumentList $selectedConfiguration.Args -PassThru @@ -88,7 +103,6 @@ function Cleanup() { # give OS time to release all files sleep -Milliseconds 100 } - rm -Force -Recurse $firebirdDir Write-Host "=== END ===" } @@ -119,6 +133,13 @@ function Tests-FirebirdClient-Default-NoCompression-CryptDisabled() { function Tests-FirebirdClient-Embedded() { Tests-FirebirdClient 'Embedded' $False 'Disabled' } +function Tests-FirebirdClient-All() { + Tests-FirebirdClient-Default-Compression-CryptRequired + Tests-FirebirdClient-Default-NoCompression-CryptRequired + Tests-FirebirdClient-Default-Compression-CryptDisabled + Tests-FirebirdClient-Default-NoCompression-CryptDisabled + Tests-FirebirdClient-Embedded +} function Tests-FirebirdClient($serverType, $compression, $wireCrypt) { pushd $testsProviderDir try {