-
Notifications
You must be signed in to change notification settings - Fork 150
230 lines (214 loc) · 6.98 KB
/
pull-request.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
name: "Pull request"
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
env:
APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }}
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
AWS_REGION: "eu-west-2"
CONTENT_CE_DIST_PATH: "./dist/content-ce"
APP_CONFIG_PROVIDER: ECM
APP_CONFIG_AUTH_TYPE: BASIC
APP_CONFIG_OAUTH2_HOST: http://localhost:4200/auth/realms/alfresco
PLAYWRIGHT_E2E_HOST: "http://localhost:4200"
APP_CONFIG_OAUTH2_CLIENTID: alfresco
APP_CONFIG_PLUGIN_AOS: true
APP_CONFIG_PLUGIN_CONTENT_SERVICE: true
APP_CONFIG_PLUGIN_FOLDER_RULES: true
APP_CONFIG_ENABLE_MOBILE_APP_SWITCH: true
APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS: "12"
APP_CONFIG_OAUTH2_IMPLICIT_FLOW: true
APP_CONFIG_OAUTH2_SILENT_LOGIN: true
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: /
APP_CONFIG_OAUTH2_REDIRECT_LOGIN: /
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: "{protocol}//{hostname}{:port}/assets/silent-refresh.html"
jobs:
lint:
name: 'lint'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run lint
build:
name: 'build'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/before-install
- run: npm ci
- run: npm run build $BUILD_OPTS
- name: upload job artifact
if: ${{ success() }}
uses: ./.github/actions/upload-job-artifact
with:
artifact: $CONTENT_CE_DIST_PATH
output: $S3_DBP_FOLDER/alfresco-content-app.tar.bz2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
unit-tests:
needs: [lint, build]
name: "Unit tests: ${{ matrix.unit-tests.name }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unit-tests:
- name: "aca-content"
- name: "adf-office-services-ext"
- name: "aca-shared"
- name: "aca-folder-rules"
- name: "aca-preview"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/before-install
- run: npm ci
- run: npm test ${{ matrix.unit-tests.name }} -- --browsers=ChromeHeadless --watch=false $TEST_OPTS
e2es:
needs: [lint, build, unit-tests]
name: 'E2e test suites: ${{ matrix.e2e-suites.name }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
e2e-suites:
- name: "authentication,listViews,navigation,application"
id: 1
- name: "search"
id: 2
- name: "viewer,infoDrawer,extensions"
id: 3
- name: "shareActions"
id: 4
- name: "pagination"
id: 5
- name: "actionsAvailableFilesFolders"
id: 6
- name: "actionsAvailableLibraries,actionsAvailableNewMenu"
id: 7
- name: "actionsAvailableSpecialPermissions"
id: 8
- name: "copyMoveActions"
id: 9
- name: "createActions"
id: 10
- name: "deleteActions"
id: 11
- name: "editActions,favoriteActions"
id: 12
- name: "libraryActions"
id: 13
- name: "uploadDownloadActions"
id: 14
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/before-install
- run: npm ci
- uses: ./.github/actions/before-e2e
with:
from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2"
to: $CONTENT_CE_DIST_PATH
id: ${{ matrix.e2e-suites.id }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- uses: ./.github/actions/run-e2e
with:
options: "--suite=${{ matrix.e2e-suites.name }}"
- uses: ./.github/actions/after-e2e
with:
id: ${{ matrix.e2e-suites.id }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
e2es-playwright:
needs: [lint, build, unit-tests]
name: 'E2e test suites: Folder Rules - Playwright'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/before-install
- run: npm ci
- uses: ./.github/actions/before-e2e
with:
from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2"
to: $CONTENT_CE_DIST_PATH
id: 15
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: before playwright
shell: bash
run: npx playwright install chromium
- uses: ./.github/actions/run-e2e
with:
options: "e2e/playwright/tests/folder-rules/playwright.config.ts"
test-runner: playwright
- uses: ./.github/actions/after-e2e
with:
id: 15
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
finalize:
needs: [lint, build, unit-tests, e2es, e2es-playwright]
name: 'Finalize'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: Check ADF link
shell: bash
run: |
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
echo -e "\e[31mPRs are not mergeable with conditional build. This build was run with custom ADF branch: $BRANCH \e[0m"
exit 1
fi;