1
+ name : Run Cross Platform Tests
2
+ on : [push]
3
+ defaults :
4
+ run :
5
+ shell : pwsh
6
+ jobs :
7
+ linux-tests :
8
+ runs-on : ubuntu-latest
9
+ env :
10
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
11
+
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ - name : Install and cache PowerShell modules
16
+ uses :
potatoqualitee/[email protected]
17
+ with :
18
+ modules-to-cache : dbatools.core.library:2022.11.8
19
+ modules-to-cache-prerelease : dbatools.library:2022.11.8-preview
20
+
21
+ - name : Install and cache dbatools.library
22
+ run : |
23
+ Import-Module ./dbatools.psd1 -Force
24
+ Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -Register
25
+ Set-DbatoolsConfig -FullName sql.connection.encrypt -Value Optional -Register
26
+ Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning
27
+
28
+ - name : Setup docker images
29
+ run : |
30
+ # create a shared network
31
+ docker network create localnet
32
+ # Expose engine and endpoint then setup a shared path for migrations
33
+ docker run -p 1433:1433 --volume shared:/shared:z --name mssql1 --hostname mssql1 --network localnet -d dbatools/sqlinstance
34
+ # Expose second engine and endpoint on different port
35
+ docker run -p 14333:1433 --volume shared:/shared:z --name mssql2 --hostname mssql2 --network localnet -d dbatools/sqlinstance2
36
+
37
+ - name : 👥 Clone appveyor repo
38
+ working-directory : /tmp
39
+ run : |
40
+ gh repo clone dataplat/appveyor-lab
41
+
42
+ - name : Run tests
43
+ env :
44
+ TENANTID : ${{secrets.TENANTID}}
45
+ CLIENTID : ${{secrets.CLIENTID}}
46
+ CLIENTSECRET : ${{secrets.CLIENTSECRET}}
47
+ run : |
48
+ Import-Module ./dbatools.psd1 -Force
49
+ Get-DbatoolsConfigValue -FullName sql.connection.trustcert | Write-Warning
50
+ Get-DbatoolsConfigValue -FullName sql.connection.encrypt | Write-Warning
51
+ $null = Invoke-Pester ./tests/gh-actions.ps1 -Output Detailed -PassThru
52
+
53
+ windows-tests :
54
+ runs-on : windows-latest
55
+ env :
56
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
57
+
58
+ steps :
59
+ - name : Checkout dbatools repo
60
+ uses : actions/checkout@v3
61
+
62
+ - name : Install and cache PowerShell modules
63
+ uses :
potatoqualitee/[email protected]
64
+ with :
65
+ shell : powershell, pwsh
66
+ modules-to-cache : dbatools.core.library:2022.11.8
67
+ modules-to-cache-prerelease : dbatools.library:2022.11.8-preview
68
+
69
+ - name : Install SQL Server localdb
70
+ uses :
potatoqualitee/[email protected]
71
+ with :
72
+ install : localdb
73
+
74
+ - name : Connect to localdb instance powershell
75
+ shell : powershell
76
+ run : |
77
+ Import-Module ./dbatools -Force
78
+ Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -PassThru | Register-DbatoolsConfig -Scope FileUserShared
79
+ Set-DbatoolsConfig -FullName sql.connection.encrypt -Value Optional -PassThru | Register-DbatoolsConfig -Scope FileUserShared
80
+ Connect-DbaInstance -SqlInstance "(localdb)\MSSQLLocalDB"
81
+
82
+ - name : Connect to localdb instance pwsh
83
+ shell : pwsh
84
+ run : |
85
+ Import-Module ./dbatools -Force
86
+ Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -PassThru | Register-DbatoolsConfig -Scope FileUserShared
87
+ Set-DbatoolsConfig -FullName sql.connection.encrypt -Value Optional -PassThru | Register-DbatoolsConfig -Scope FileUserShared
88
+ Connect-DbaInstance -SqlInstance "(localdb)\MSSQLLocalDB"
89
+
90
+ - name : Run pwsh tests
91
+ env :
92
+ TENANTID : ${{secrets.TENANTID}}
93
+ CLIENTID : ${{secrets.CLIENTID}}
94
+ CLIENTSECRET : ${{secrets.CLIENTSECRET}}
95
+ shell : pwsh
96
+ run : $null = Invoke-Pester ./tests/gh-winactions.ps1 -Output Detailed -PassThru
97
+
98
+ - name : Run PowerShell tests
99
+ env :
100
+ TENANTID : ${{secrets.TENANTID}}
101
+ CLIENTID : ${{secrets.CLIENTID}}
102
+ CLIENTSECRET : ${{secrets.CLIENTSECRET}}
103
+ shell : powershell
104
+ run : $null = Invoke-Pester ./tests/gh-winactions.ps1 -Output Detailed -PassThru
0 commit comments