awesome #1242
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Cross Platform Tests | |
on: [push] | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
linux-tests: | |
env: | |
SMODefaultModuleName: dbatools | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install and cache PowerShell modules | |
uses: potatoqualitee/[email protected] | |
with: | |
modules-to-cache: dbatools.library:2024.4.12 | |
- name: Set encryption values | |
run: | | |
Import-Module ./dbatools.psd1 -Force | |
Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -Register | |
Set-DbatoolsConfig -FullName sql.connection.encrypt -Value $false -Register | |
Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning | |
- name: Setup docker images | |
run: | | |
# create a shared network | |
docker network create localnet | |
# Expose engine and endpoint then setup a shared path for migrations | |
docker run -p 1433:1433 --volume shared:/shared:z --name mssql1 --hostname mssql1 --network localnet -d dbatools/sqlinstance | |
# Expose second engine and endpoint on different port | |
docker run -p 14333:1433 --volume shared:/shared:z --name mssql2 --hostname mssql2 --network localnet -d dbatools/sqlinstance2 | |
- name: 👥 Clone appveyor repo | |
working-directory: /tmp | |
run: | | |
gh repo clone dataplat/appveyor-lab | |
- name: Run tests | |
env: | |
TENANTID: ${{secrets.TENANTID}} | |
CLIENTID: ${{secrets.CLIENTID}} | |
CLIENTSECRET: ${{secrets.CLIENTSECRET}} | |
CLIENT_GUID: ${{secrets.CLIENT_GUID}} | |
CLIENT_GUID_SECRET: ${{secrets.CLIENT_GUID_SECRET}} | |
run: | | |
Import-Module ./dbatools.psd1 -Force | |
Get-DbatoolsConfigValue -FullName sql.connection.trustcert | Write-Warning | |
Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning | |
$null = Invoke-Pester ./tests/gh-actions.ps1 -Output Detailed -PassThru | |
windows-tests: | |
env: | |
SMODefaultModuleName: dbatools | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout dbatools repo | |
uses: actions/checkout@v3 | |
- name: Install and cache PowerShell modules | |
uses: potatoqualitee/[email protected] | |
with: | |
shell: powershell, pwsh | |
modules-to-cache: dbatools.library:2024.4.12 | |
- name: Install SQL Server localdb | |
uses: potatoqualitee/[email protected] | |
with: | |
install: localdb | |
- name: Connect to localdb instance powershell | |
shell: powershell | |
run: | | |
Import-Module ./dbatools -Force | |
Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -PassThru | Register-DbatoolsConfig -Scope FileUserShared | |
Set-DbatoolsConfig -FullName sql.connection.encrypt -Value $false -PassThru | Register-DbatoolsConfig -Scope FileUserShared | |
Connect-DbaInstance -SqlInstance "(localdb)\MSSQLLocalDB" | |
- name: Connect to localdb instance pwsh | |
shell: pwsh | |
run: | | |
Import-Module ./dbatools -Force | |
Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -PassThru | Register-DbatoolsConfig -Scope FileUserShared | |
Set-DbatoolsConfig -FullName sql.connection.encrypt -Value $false -PassThru | Register-DbatoolsConfig -Scope FileUserShared | |
Connect-DbaInstance -SqlInstance "(localdb)\MSSQLLocalDB" | |
- name: Run pwsh tests | |
env: | |
TENANTID: ${{secrets.TENANTID}} | |
CLIENTID: ${{secrets.CLIENTID}} | |
CLIENTSECRET: ${{secrets.CLIENTSECRET}} | |
CLIENT_GUID: ${{secrets.CLIENT_GUID}} | |
CLIENT_GUID_SECRET: ${{secrets.CLIENT_GUID_SECRET}} | |
shell: pwsh | |
run: $null = Invoke-Pester ./tests/gh-winactions.ps1 -Output Detailed -PassThru | |
- name: Run PowerShell tests | |
env: | |
TENANTID: ${{secrets.TENANTID}} | |
CLIENTID: ${{secrets.CLIENTID}} | |
CLIENTSECRET: ${{secrets.CLIENTSECRET}} | |
shell: powershell | |
run: $null = Invoke-Pester ./tests/gh-winactions.ps1 -Output Detailed -PassThru |