-
Notifications
You must be signed in to change notification settings - Fork 69
170 lines (147 loc) · 5.69 KB
/
paportal-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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Actions workflow for merges to main
name: paportal-rolling-instance-actions
on:
workflow_dispatch: # allow for manual workflow triggering as needed
inputs:
runPAPortalTests:
description: 'Run paportal commands by installing portal packages in fresh environment'
required: false
default: 'yes'
push:
branches: [ main ]
jobs:
instance-actions:
runs-on: ${{ matrix.os }}
outputs:
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }}
strategy:
matrix:
os: [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
PORTAL_WORKING_DIRECTORY: ./paportal-download
PORTAL_MANIFEST_FILE_PATH: ./starter-portal/.portalconfig/*-manifest.yml
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://npm.pkg.github.com
- name: Install NPM packages
run: |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GPR_ACCESS_TOKEN }}
npm ci
env:
AZ_DevOps_Read_PAT: ${{ secrets.AZ_DevOps_Read_PAT }}
- name: Download CDSStarterPortal package from portal authenticated feed
run: gulp fetchPortalPackage --feedPAT ${{ secrets.OneCRM_DevOps_Read_PAT }}
- name: Install PAC
uses: ./actions-install
id: actions-install
- name: Create a PA Portal test env
uses: ./create-environment
id: create-paportal-environment
env:
PP_SRC_ENV_NAME: ci-actions-paportal
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: Deploy paportal-package action to create a test Portal
if: matrix.os == 'windows-latest'
uses: ./deploy-package
with:
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
tenant-id: ${{ env.WF_TENANT_ID }}
package: 'out\portal_package\Adxstudio.CDSStarterPortal.dll'
- name: Test paportal-download action with username/password
uses: ./download-paportal
with:
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
website-id: f46b70cc-580b-4f1a-87c3-41deb48eb90d
download-path: ./paportal-download
- name: Delete portal manifest before uploading
working-directory: ${{ env.PORTAL_WORKING_DIRECTORY }}
run: rm ${{ env.PORTAL_MANIFEST_FILE_PATH }}
- name: Test paportal-upload action with username/password
uses: ./upload-paportal
with:
environment-url: ${{ steps.create-paportal-environment.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
upload-path: ./paportal-download/starter-portal
- 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
linux-instance-actions:
needs: instance-actions
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-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
PORTAL_WORKING_DIRECTORY: ./paportal-download
PORTAL_MANIFEST_FILE_PATH: ./starter-portal/.portalconfig/*-manifest.yml
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install PAC
uses: ./actions-install
id: actions-install
- name: Test paportal-download action with username/password
uses: ./download-paportal
with:
environment-url: ${{ needs.instance-actions.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
website-id: f46b70cc-580b-4f1a-87c3-41deb48eb90d
download-path: ./paportal-download
- name: Delete portal manifest before uploading
working-directory: ${{ env.PORTAL_WORKING_DIRECTORY }}
run: rm ${{ env.PORTAL_MANIFEST_FILE_PATH }}
- name: Test paportal-upload action with username/password
uses: ./upload-paportal
with:
environment-url: ${{ needs.instance-actions.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
upload-path: ./paportal-download/starter-portal
- name: Delete PA Portal test environment
if: always() # Clean up created environments even on failed run
uses: ./delete-environment
with:
environment-url: ${{ needs.instance-actions.outputs.environment-url }}
user-name: ${{ env.WF_USERNAME }}
password-secret: ${{ secrets.PASSWORD_PPDEVTOOLS }}
- 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