@@ -357,8 +357,97 @@ jobs:
357
357
}
358
358
}
359
359
360
+ advanced-test :
361
+ name : Advanced Integration Tests
362
+ runs-on : ubuntu-latest
363
+ needs : test-sqlpackage
364
+ env :
365
+ SMODefaultModuleName : dbatools
366
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
367
+
368
+ steps :
369
+ - name : Download dbatools.library artifact
370
+ uses : actions/download-artifact@v4
371
+ with :
372
+ name : dbatools-library-zip
373
+
374
+ - name : Extract dbatools.library
375
+ shell : pwsh
376
+ run : |
377
+ # Create artifacts directory if it doesn't exist
378
+ New-Item -ItemType Directory -Path ./artifacts -Force | Out-Null
379
+
380
+ # Extract the zip file
381
+ Expand-Archive -Path ./dbatools.library.zip -DestinationPath ./artifacts -Force
382
+
383
+ # Verify extraction
384
+ if (Test-Path ./artifacts/dbatools.library/dbatools.library.psd1) {
385
+ Write-Host "✅ dbatools.library extracted successfully" -ForegroundColor Green
386
+ } else {
387
+ Write-Error "❌ Failed to extract dbatools.library properly"
388
+ Get-ChildItem ./artifacts -Recurse | Select-Object FullName
389
+ exit 1
390
+ }
391
+
392
+ - name : Checkout dbatools repo (development branch)
393
+ uses : actions/checkout@v4
394
+ with :
395
+ repository : dataplat/dbatools
396
+ ref : development
397
+ path : dbatools
398
+
399
+ - name : Ensure sqlpackage is executable
400
+ run : chmod +x ./artifacts/dbatools.library/core/lib/dac/linux/sqlpackage || true
401
+
402
+ - name : Check file health and set encryption values
403
+ shell : pwsh
404
+ run : |
405
+ # Import the built dbatools.library from artifact
406
+ Import-Module ./artifacts/dbatools.library/dbatools.library.psd1 -Force
407
+ Import-Module ./dbatools/dbatools.psd1 -Force
408
+
409
+ Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -Register
410
+ Set-DbatoolsConfig -FullName sql.connection.encrypt -Value $false -Register
411
+ Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning
412
+ mkdir /tmp/DbatoolsExport
413
+
414
+ - name : Setup docker images
415
+ run : |
416
+ # create a shared network
417
+ docker network create localnet
418
+ # Expose engine and endpoint then setup a shared path for migrations
419
+ docker run -p 1433:1433 --volume shared:/shared:z --name mssql1 --hostname mssql1 --network localnet -d dbatools/sqlinstance
420
+ # Expose second engine and endpoint on different port
421
+ docker run -p 14333:1433 --volume shared:/shared:z --name mssql2 --hostname mssql2 --network localnet -d dbatools/sqlinstance2
422
+
423
+ - name : Clone appveyor repo
424
+ working-directory : /tmp
425
+ run : |
426
+ gh repo clone dataplat/appveyor-lab
427
+
428
+ - name : Run advanced integration tests
429
+ shell : pwsh
430
+ env :
431
+ TENANTID : ${{secrets.TENANTID}}
432
+ CLIENTID : ${{secrets.CLIENTID}}
433
+ CLIENTSECRET : ${{secrets.CLIENTSECRET}}
434
+ CLIENT_GUID : ${{secrets.CLIENT_GUID}}
435
+ CLIENT_GUID_SECRET : ${{secrets.CLIENT_GUID_SECRET}}
436
+ run : |
437
+ # Import the built dbatools.library from artifact (ensure it's loaded first)
438
+ Import-Module ./artifacts/dbatools.library/dbatools.library.psd1 -Force
439
+
440
+ # Import dbatools from the development branch checkout
441
+ Import-Module ./dbatools/dbatools.psd1 -Force
442
+
443
+ Get-DbatoolsConfigValue -FullName sql.connection.trustcert | Write-Warning
444
+ Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning
445
+
446
+ # Run the integration tests using the script from the dbatools repo
447
+ $null = Invoke-Pester ./dbatools/.github/scripts/gh-actions.ps1 -Output Detailed -PassThru
448
+
360
449
create-preview-release :
361
- needs : [linux-build, build-windows, test-sqlpackage]
450
+ needs : [linux-build, build-windows, test-sqlpackage, advanced-test ]
362
451
runs-on : windows-latest
363
452
# Create release if manually triggered OR if version contains "preview"
364
453
if : github.event_name == 'workflow_dispatch' || github.event_name == 'push'
0 commit comments