-
-
Notifications
You must be signed in to change notification settings - Fork 808
132 lines (114 loc) · 5 KB
/
prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Run Prerelease Tests
on: workflow_dispatch
defaults:
run:
shell: pwsh
jobs:
linux-tests:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v3
- name: Install dbatools prerelease
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module dbatools -AllowPrerelease
Set-DbatoolsConfig -Name Import.EncryptionMessageCheck -Value $false -PassThru | Register-DbatoolsConfig
- name: Measure import speed on pwsh
run: |
Measure-Command { Import-Module dbatools }
Get-Module dbatools
- name: Set encryption values
run: |
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
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:
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- name: Checkout dbatools repo
uses: actions/checkout@v3
- name: Install dbatools prerelease on pwsh
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module dbatools -AllowPrerelease
- name: Install dbatools prerelease on powershell
shell: powershell
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module dbatools.library
Install-Module dbatools -AllowPrerelease
- name: Measure import speed on pwsh
run: |
Measure-Command { Import-Module dbatools }
Get-Module dbatools
- name: Measure import speed on powershell
shell: powershell
run: |
Import-Module dbatools.library
Measure-Command { Import-Module dbatools }
Get-Module dbatools
- name: Install SQL Server localdb
uses: potatoqualitee/[email protected]
with:
install: localdb
- name: Connect to localdb instance powershell
shell: powershell
run: |
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: |
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: |
Import-Module dbatools
$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: |
Import-Module dbatools
$null = Invoke-Pester ./tests/gh-winactions.ps1 -Output Detailed -PassThru