-
Notifications
You must be signed in to change notification settings - Fork 66
287 lines (254 loc) · 10.7 KB
/
rolling-instance-actions.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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# Actions workflow for merges to main
name: rolling-instance-actions
on:
workflow_dispatch: # allow for manual workflow triggering as needed
inputs:
runSlowCRUD:
description: 'run slow CRUD actions like copy-env, backup-env, restore-env, reset-env (default: yes)'
required: false
default: 'yes'
push:
branches: [ main ]
permissions:
id-token: write # OIDC token for Workload Identity Federation
jobs:
instance-actions:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
env:
RUNNER_DEBUG: 1
WF_USERNAME: [email protected]
WF_APPID: ddb0fc45-d55c-4fd6-af4a-152359bb4ebd
WF_TENANT_ID: 3041a058-5110-495a-a575-b2a5571d9eac
WF_USER_ROLE: "Bot Author"
WF_USER_AAD_OBJECT_ID: "85fd1857-ddef-46f6-acf4-22a0d1df2cda"
WF_APP_USER_ID: "82e66a08-8bf9-42bf-883a-7e2d17c7cede"
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install PAC
uses: ./actions-install
id: actions-install
- name: Test create-source-environment action with appId-clientSecret
uses: ./create-environment
id: create-source-environment
env:
PP_SRC_ENV_NAME: ${{ format('ci-actions-src-{0}', runner.os) }}
with:
app-id: ${{ env.WF_APPID }}
client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
name: ${{ env.PP_SRC_ENV_NAME }}
type: Sandbox
region: unitedstates
domain: ${{ env.PP_SRC_ENV_NAME }}
- name: Test create-target-environment action with username/password
uses: ./create-environment
id: create-target-environment
env:
PP_TRG_ENV_NAME: ${{ format('ci-actions-trg-{0}', runner.os) }}
with:
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
name: ${{ env.PP_TRG_ENV_NAME }}
type: Sandbox
region: unitedstates
domain: ${{ env.PP_TRG_ENV_NAME }}
- name: Test who-am-i action with appId-clientSecret
uses: ./who-am-i
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
app-id: ${{ env.WF_APPID }}
client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
- name: Test who-am-i action with appId + Workload Identity Federation
uses: ./who-am-i
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
app-id: ${{ env.WF_APPID }}
tenant-id: ${{ env.WF_TENANT_ID }}
- name: Test who-am-i action with username/password
uses: ./who-am-i
with:
environment-url: ${{ steps.create-target-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
# - name: Install AppSource application
# uses: ./install-application
# with:
# environment: ${{ steps.create-source-environment.outputs.environment-url }}
# app-id: ${{ env.WF_APPID }}
# client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }}
# tenant-id: ${{ env.WF_TENANT_ID }}
# application-list: 'src/test/data/appsToInstall.json'
- name: Test assign-user action
if: startsWith(github.event.inputs.runSlowCRUD, 'no')
uses: ./assign-user
with:
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
environment: ${{ steps.create-source-environment.outputs.environment-url }}
user: ${{ env.WF_USER_AAD_OBJECT_ID}}
role: ${{ env.WF_USER_ROLE}}
- name: Test assign-user action as application user
if: startsWith(github.event.inputs.runSlowCRUD, 'no')
uses: ./assign-user
with:
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
environment: ${{ steps.create-source-environment.outputs.environment-url }}
user: ${{ env.WF_APP_USER_ID}}
role: ${{ env.WF_USER_ROLE}}
application-user: true
- name: Test assign-group action
if: startsWith(github.event.inputs.runSlowCRUD, 'no')
uses: ./assign-group
with:
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
environment: ${{ steps.create-source-environment.outputs.environment-url }}
group: 'fef01b9b-da30-4cb5-b6b9-ff34c5d2ca2e'
group-name: 'Test Group'
role: 'System Customizer'
team-type: 'AadSecurityGroup'
membership-type: 'Members'
- name: Test unpack-solution action
uses: ./unpack-solution
with:
solution-folder: 'out/CI/emptySolution/src'
solution-file: 'src/test/data/TrivialCanvasSolution.zip'
solution-type: 'Unmanaged'
overwrite-files: true
error-level: Error
locale-template: 'en-US'
localize: true
process-canvas-apps: true
- name: Test pack-solution action
uses: ./pack-solution
with:
solution-folder: 'src/test/data/emptySolution'
solution-file: 'out/CI/emptySolution.zip'
solution-type: 'Unmanaged'
error-level: Error
localize: true
- name: Check solution
uses: ./check-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
path: 'src/test/data/empty*.zip'
- name: Test import-solution action with username/password
uses: ./import-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
solution-file: 'src/test/data/emptySolution_0_1_0_0.zip'
force-overwrite: true
run-asynchronously: true
- name: Test export-solution action with username/password
uses: ./export-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
solution-name: emptySolution
solution-output-file: 'solution1.zip'
working-directory: 'out/CI'
run-asynchronously: true
- name: Test unpack-solution action
uses: ./unpack-solution
with:
solution-file: 'out/CI/solution1.zip'
solution-folder: 'out/CI/solution one'
solution-type: 'Unmanaged'
overwrite-files: true
- name: Test clone-solution action with username/password
uses: ./clone-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
solution-name: emptySolution
target-folder: 'out/CI/cloned'
- name: Test publish-solution action with username/password
uses: ./publish-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- name: Test delete-solution action with username/password
uses: ./delete-solution
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
solution-name: emptySolution
- name: Test deploy-package action with username-password
if: matrix.os == 'windows-latest'
uses: ./deploy-package
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
package: 'src\test\data\pkgDeployTestData\CDSPackage.dll'
- name: Test copy-environment action with username/password
if: startsWith(github.event.inputs.runSlowCRUD, 'yes')
uses: ./copy-environment
with:
source-url: ${{ steps.create-source-environment.outputs.environment-url }}
target-url: ${{ steps.create-target-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- name: Test backup-environment action with appId-clientSecret
if: startsWith(github.event.inputs.runSlowCRUD, 'yes')
uses: ./backup-environment
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
backup-label: test-backup-label
app-id: ${{ env.WF_APPID }}
client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
- name: Test reset-environment action with username/password
if: startsWith(github.event.inputs.runSlowCRUD, 'yes')
uses: ./reset-environment
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- name: Test restore-environment action with username/password
if: startsWith(github.event.inputs.runSlowCRUD, 'yes')
uses: ./restore-environment
with:
source-url: ${{ steps.create-source-environment.outputs.environment-url }}
target-url: ${{ steps.create-target-environment.outputs.environment-url }}
selected-backup: latest
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- name: Test delete-source-environment action with appId-clientSecret
if: always() # Clean up created environments even on failed run
uses: ./delete-environment
with:
environment-url: ${{ steps.create-source-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- name: Test delete-target-environment action with username/password
if: always() # Clean up created environments even on failed run
uses: ./delete-environment
with:
environment-url: ${{ steps.create-target-environment.outputs.environment-url }}
app-id: ${{ env.WF_APPID }}
client-secret: ${{ secrets.CLIENT_SECRET_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
- name: Upload pac CLI logs
if: always()
uses: actions/upload-artifact@v3
with:
name: pac-cli-log ${{ matrix.os }}
path: ./dist/pac*/tools/logs/pac-log.txt