-
Notifications
You must be signed in to change notification settings - Fork 0
310 lines (298 loc) · 10.8 KB
/
Copy pathweb-merge-request.yml
File metadata and controls
310 lines (298 loc) · 10.8 KB
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: Ecosystem branch check (Web)
on:
workflow_dispatch:
inputs:
branch:
type: string
required: true
concurrency:
group: ${{ inputs.branch }}
cancel-in-progress: true
jobs:
validate-js-PRs:
uses: Geode-solutions/Versions/.github/workflows/validate-pr.yml@master
with:
branch: ${{ inputs.branch }}
repos: "Vease;Vease-Modeling;PEGGHy;OpenGeodeWeb-Front"
workflow: js
secrets: inherit
validate-py-PRs:
uses: Geode-solutions/Versions/.github/workflows/validate-pr.yml@master
with:
branch: ${{ inputs.branch }}
repos: "Vease-Viewer;PEGGHy-Viewer;OpenGeodeWeb-Viewer;Vease-Back;Vease-Modeling-Back;PEGGHy-Back;OpenGeodeWeb-Back;OpenGeodeWeb-Microservice"
workflow: py
secrets: inherit
base:
needs: [validate-js-PRs, validate-py-PRs]
runs-on: ubuntu-latest
outputs:
base: ${{ steps.base.outputs.base }}
steps:
- name: Set base branch
id: base
run: |
echo "JS base: ${{ needs.validate-js-PRs.outputs.base }}"
echo "Py base: ${{ needs.validate-py-PRs.outputs.base }}"
if [[ -n "${{ needs.validate-js-PRs.outputs.base }}" ]]; then
echo "Using JS base"
echo "base=${{ needs.validate-js-PRs.outputs.base }}" >> $GITHUB_OUTPUT
elif [[ -n "${{ needs.validate-py-PRs.outputs.base }}" ]]; then
echo "Using Py base"
echo "base=${{ needs.validate-py-PRs.outputs.base }}" >> $GITHUB_OUTPUT
else
echo "Using default base 'next'"
echo "base=next" >> $GITHUB_OUTPUT
fi
tarballs:
needs: [validate-js-PRs, validate-py-PRs, base]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- uses: Geode-solutions/actions/get-release@master
id: repos
with:
repository: ${{ needs.validate-js-PRs.outputs.repos }};${{ needs.validate-py-PRs.outputs.repos }}
file: ".tgz"
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
base: ${{ needs.base.outputs.base }}
- name: Save data to file
run: echo "${{ steps.repos.outputs.path }}" > repos_path.txt
- uses: actions/upload-artifact@v7
with:
name: tarballs-${{ runner.os }}
path: .
wheels:
needs: [validate-js-PRs, validate-py-PRs, base]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- uses: Geode-solutions/actions/get-release@master
id: repos
with:
repository: ${{ needs.validate-py-PRs.outputs.repos }}
file: ".whl"
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
base: ${{ needs.base.outputs.base }}
- name: Save data to file
run: echo "${{ steps.repos.outputs.path }}" > repos_path.txt
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ runner.os }}
path: .
pyinstallers:
needs: [validate-js-PRs, validate-py-PRs, base]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- uses: Geode-solutions/actions/get-release@master
id: repos
with:
repository: ${{ needs.validate-py-PRs.outputs.repos }}
file: "pyinstaller-${{ runner.os }}.zip"
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
base: ${{ needs.base.outputs.base }}
- name: Archive pyinstaller
uses: thedoctor0/zip-release@0.7.5
with:
filename: pyinstallers.zip
- uses: actions/upload-artifact@v7
with:
name: pyinstallers-${{ runner.os }}
path: pyinstallers.zip
test-js:
needs: [validate-js-PRs, tarballs, pyinstallers, base]
runs-on: ${{ matrix.os }}
strategy:
matrix:
config: ${{ fromJSON(needs.validate-js-PRs.outputs.repo_configs) }}
os: [ubuntu-latest, windows-2022]
fail-fast: false
steps:
- name: Clone repository
uses: Geode-solutions/actions/install/checkout@master
with:
repo: "Geode-solutions/${{ matrix.config.repo }}"
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
base: ${{ needs.base.outputs.base }}
- uses: actions/download-artifact@v8
with:
name: tarballs-${{ runner.os }}
- name: Get tarballs
id: tarballs
run: |
tarballs=$(cat repos_path.txt)
echo "$tarballs"
echo "tarballs=$tarballs" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/download-artifact@v8
with:
name: pyinstallers-${{ runner.os }}
- name: Get pyinstallers
id: pyinstallers
run: |
ls
unzip pyinstallers.zip
ls -l
pyinstallers=$(cat repos_path.txt)
echo "$pyinstallers"
echo "pyinstallers=$pyinstallers" >> $GITHUB_OUTPUT
shell: bash
- name: Get license
uses: Geode-solutions/actions/install/license@master
with:
token: ${{ secrets.TOKEN }}
- name: Test Node
if: matrix.config.config == 'node'
uses: Geode-solutions/actions/test/node@master
with:
branch: ${{ inputs.branch }}
tarballs: ${{ steps.tarballs.outputs.tarballs }}
token: ${{ secrets.TOKEN }}
use_registry: false
- name: Test Integration
if: matrix.config.config == 'integration'
uses: Geode-solutions/actions/test/integration@master
with:
branch: ${{ inputs.branch }}
token: ${{ secrets.TOKEN }}
tarballs: ${{ steps.tarballs.outputs.tarballs }}
pyinstallers: ${{ steps.pyinstallers.outputs.pyinstallers }}
use_registry: false
- name: Test Browser
if: matrix.config.config == 'browser'
uses: Geode-solutions/actions/test/browser@master
with:
name: ${{ matrix.config.repo }}
branch: ${{ inputs.branch }}
token: ${{ secrets.TOKEN }}
tarballs: ${{ steps.tarballs.outputs.tarballs }}
pyinstallers: ${{ steps.pyinstallers.outputs.pyinstallers }}
use_registry: false
- name: Test Desktop
if: matrix.config.config == 'desktop'
uses: Geode-solutions/actions/test/desktop@master
with:
name: ${{ matrix.config.repo }}
branch: ${{ inputs.branch }}
token: ${{ secrets.TOKEN }}
tarballs: ${{ steps.tarballs.outputs.tarballs }}
pyinstallers: ${{ steps.pyinstallers.outputs.pyinstallers }}
AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }}
use_registry: false
- name: Test Extension
if: matrix.config.config == 'extension'
uses: Geode-solutions/actions/test/extension@master
with:
branch: ${{ inputs.branch }}
token: ${{ secrets.TOKEN }}
tarballs: ${{ steps.tarballs.outputs.tarballs }}
pyinstallers: ${{ steps.pyinstallers.outputs.pyinstallers }}
use_registry: false
- name: Post to a Slack channel
if: failure()
id: slack
uses: slackapi/slack-github-action@v1
with:
channel-id: C0598GTCLGH
slack-message: "${{ inputs.branch }}: Javascript merge request failed for ${{ matrix.config.repo }} on ${{ runner.os }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
test-py:
needs: [validate-py-PRs, wheels, base]
runs-on: ${{ matrix.os }}
strategy:
matrix:
config: ${{ fromJSON(needs.validate-py-PRs.outputs.repo_configs) }}
os: [ubuntu-latest, windows-2022]
fail-fast: false
steps:
- name: Clone repository
uses: Geode-solutions/actions/install/checkout@master
with:
repo: "Geode-solutions/${{ matrix.config.repo }}"
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
base: ${{ needs.base.outputs.base }}
- uses: actions/download-artifact@v8
with:
name: wheels-${{ runner.os }}
- name: Get wheels
id: wheels
run: |
wheels=$(cat repos_path.txt)
echo "$wheels"
echo "wheels=$wheels" >> $GITHUB_OUTPUT
shell: bash
- name: Get license
uses: Geode-solutions/actions/install/license@master
with:
token: ${{ secrets.TOKEN }}
- name: Test Python
if: matrix.config.config == 'python'
uses: Geode-solutions/actions/test/python@master
with:
token: ${{ secrets.TOKEN }}
branch: ${{ inputs.branch }}
wheels: ${{ steps.wheels.outputs.wheels }}
use_registry: false
- name: Build docker
if: matrix.config.config == 'docker' && runner.os != 'Windows'
uses: Geode-solutions/actions/build/docker@master
id: docker
with:
tag: test
license_token: ${{ secrets.TOKEN }}
- name: Post to a Slack channel
if: failure()
id: slack
uses: slackapi/slack-github-action@v1
with:
channel-id: C0598GTCLGH
slack-message: "${{ inputs.branch }}: Python merge request failed for ${{ matrix.config.repo }} on ${{ runner.os }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
merge-PRs:
needs: [validate-js-PRs, validate-py-PRs, test-js, test-py]
uses: Geode-solutions/Versions/.github/workflows/merge-pr.yml@master
with:
branch: ${{ inputs.branch }}
repos: ${{ needs.validate-js-PRs.outputs.repos }};${{ needs.validate-py-PRs.outputs.repos }}
secrets: inherit
deploy:
runs-on: ubuntu-latest
needs: [merge-PRs, base]
steps:
- uses: actions/github-script@v8
with:
github-token: ${{ secrets.TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'Geode-solutions',
repo: 'Versions',
workflow_id: 'deploy.yml',
ref: 'master',
inputs: { branch: '${{ needs.base.outputs.base }}', workflow: 'web' }
})
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1
with:
channel-id: C0598GTCLGH
slack-message: "Merge request for ${{ inputs.branch }} complete :tada:"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}