forked from microsoft/AL-Go
-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (141 loc) · 7.62 KB
/
E2E.yaml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: End to end tests
on:
workflow_dispatch:
defaults:
run:
shell: PowerShell
jobs:
Check:
runs-on: [ windows-latest ]
steps:
- name: Check secrets
run: |
$err = $false
if ('${{ Secrets.OrgPAT }}' -eq '') {
Write-Host "::Error::In order to run end to end tests, you need a Secret called OrgPAT containing a valid Personal Access Token"
$err = $true
}
if ('${{ Secrets.githubOwner }}' -eq '') {
Write-Host "::Error::In order to run end to end tests, you need a Secret called githubOwner containing a the name of the owner of temp repositories"
$err = $true
}
if ('${{ Secrets.adminCenterApiCredentials }}' -eq '') {
Write-Host "::Error::In order to run end to end tests, you need a Secret called adminCenterApiCredentials containing API access credentials for BC Admin Center"
$err = $true
}
if ('${{ Secrets.licenseFileUrl }}' -eq '') {
Write-Host "::Error::In order to run end to end tests, you need a Secret called licenseFileUrl containing a secure Url to a build license file"
$err = $true
}
if ($err) {
exit 1
}
SetupRepositories:
runs-on: [ windows-latest ]
needs: [ Check ]
outputs:
actionsRepo: ${{ steps.setup.outputs.actionsRepo }}
perTenantExtensionRepo: ${{ steps.setup.outputs.perTenantExtensionRepo }}
appSourceAppRepo: ${{ steps.setup.outputs.appSourceAppRepo }}
steps:
- uses: actions/checkout@v2
- name: Setup Repositories
id: setup
run: e2eTests\SetupRepositories.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}'
CalculateReleases:
runs-on: [ windows-latest ]
needs: [ Check ]
outputs:
releases: ${{ steps.calculatereleases.outputs.releases }}
steps:
- uses: actions/checkout@v2
- name: CalculateReleases
id: calculateReleases
run: |
$modulePath = (Get-Item ".\e2eTests\e2eTestHelper.psm1").FullName
Import-Module $modulePath -DisableNameChecking
SetTokenAndRepository -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -repository "$ENV:GITHUB_REPOSITORY" -github
$releases = @(gh release list --repo $ENV:GITHUB_REPOSITORY | ForEach-Object { $_.split("`t")[0] })
Write-Host "Releases: $($releases -join ', ')"
if ($releases.Count -eq 1) {
$releasesJSon = "[$($releases | ConvertTo-Json -compress)]"
}
else {
$releasesJSon = $releases | ConvertTo-Json -compress
}
Write-Host "::set-output name=releases::$releasesJson"
Write-Host "::set-output name=releasesCount::$($releases.Count)"
Write-Host "set-output name=releases::$releasesJson"
Write-Host "set-output name=releasesCount::$($releases.Count)"
TestAlGoPtePrivate:
runs-on: [ windows-latest ]
needs: [ SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -adminCenterApiCredentials '${{ Secrets.adminCenterApiCredentials }}' -private
TestAlGoAppSourcePrivate:
runs-on: [ windows-latest ]
needs: [SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiCredentials '' -licenseFileUrl '${{ Secrets.LicenseFileUrl }}' -appSourceApp -private
TestAlGoPte:
runs-on: [ windows-latest ]
needs: [ SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -adminCenterApiCredentials '${{ Secrets.adminCenterApiCredentials }}'
TestAlGoPteMultiProject:
runs-on: [ windows-latest ]
needs: [ SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -multiProject
TestAlGoAppSource:
runs-on: [ windows-latest ]
needs: [SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiCredentials '' -licenseFileUrl '${{ Secrets.LicenseFileUrl }}' -appSourceApp
TestAlGoAppSourceMultiProject:
runs-on: [ windows-latest ]
needs: [ SetupRepositories ]
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template '${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiCredentials '' -licenseFileUrl '${{ Secrets.LicenseFileUrl }}' -multiProject -appSourceApp
TestAlGoPteUpgrade:
runs-on: [ windows-latest ]
needs: [SetupRepositories, CalculateReleases ]
strategy:
matrix:
release: ${{ fromJson(needs.CalculateReleases.outputs.releases) }}
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go-Upgrade.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -template '${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -release '${{ matrix.release }}' -path 'pte'
TestAlGoAppSourceUpgrade:
runs-on: [ windows-latest ]
needs: [SetupRepositories, CalculateReleases ]
strategy:
matrix:
release: ${{ fromJson(needs.CalculateReleases.outputs.releases) }}
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Run tests
run: e2eTests\Test-AL-Go-Upgrade.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -template '${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -release '${{ matrix.release }}' -licenseFileUrl '${{ Secrets.LicenseFileUrl }}' -path 'appsourceapp' -appSourceApp
RemoveRepositories:
runs-on: [ windows-latest ]
needs: [ SetupRepositories, TestAlGoPtePrivate, TestAlGoAppSourcePrivate, TestAlGoPte, TestAlGoPteMultiProject, TestAlGoAppSource, TestAlGoAppSourceMultiProject, TestAlGoPteUpgrade, TestAlGoAppSourceUpgrade ]
if: always() && (${{ needs.SetupRepositories.result == 'Success' }})
steps:
- uses: actions/checkout@v2
- name: Remove Repositories
run: e2eTests\RemoveRepositories.ps1 -github -githubOwner '${{ Secrets.githubOwner }}' -token '${{ Secrets.OrgPAT }}' -actionsRepo '${{ needs.SetupRepositories.outputs.actionsRepo }}' -perTenantExtensionRepo '${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -appSourceAppRepo '${{ needs.SetupRepositories.outputs.appSourceAppRepo }}'