generated from microsoft/AL-Go-PTE
-
Notifications
You must be signed in to change notification settings - Fork 5
265 lines (240 loc) · 10.3 KB
/
_BuildALGoProject.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
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
name: '_Build AL-Go project'
run-name: 'Build ${{ inputs.project }}'
on:
workflow_call:
inputs:
shell:
description: Shell in which you want to run the action (powershell or pwsh)
required: false
default: powershell
type: string
runsOn:
description: JSON-formatted string of the types of machine to run the build job on
required: true
type: string
checkoutRef:
description: Ref to checkout
required: false
default: ${{ github.sha }}
type: string
project:
description: Name of the built project
required: true
type: string
projectName:
description: Friendly name of the built project
required: true
type: string
projectDependenciesJson:
description: Dependencies of the built project in compressed Json format
required: false
default: '{}'
type: string
buildMode:
description: Build mode used when building the artifacts
required: true
type: string
baselineWorkflowRunId:
description: ID of the baseline workflow run, from where to download the current project dependencies, in case they are not built in the current workflow run
required: false
default: '0'
type: string
secrets:
description: A comma-separated string with the names of the secrets, required for the workflow.
required: false
default: ''
type: string
publishThisBuildArtifacts:
description: Flag indicating whether this build artifacts should be published
type: boolean
default: false
publishArtifacts:
description: Flag indicating whether the artifacts should be published
type: boolean
default: false
artifactsNameSuffix:
description: Suffix to add to the artifacts names
required: false
default: ''
type: string
signArtifacts:
description: Flag indicating whether the apps should be signed
type: boolean
default: false
useArtifactCache:
description: Flag determining whether to use the Artifacts Cache
type: boolean
default: false
permissions:
actions: read
contents: read
id-token: write
env:
ALGoOrgSettings: ${{ vars.ALGoOrgSettings }}
ALGoRepoSettings: ${{ vars.ALGoRepoSettings }}
jobs:
BuildALGoProject:
needs: [ ]
runs-on: ${{ fromJson(inputs.runsOn) }}
defaults:
run:
shell: ${{ inputs.shell }}
name: ${{ inputs.projectName }} (${{ inputs.buildMode }})
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkoutRef }}
lfs: true
- name: Read settings
uses: microsoft/AL-Go-Actions/[email protected]
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}
get: useCompilerFolder,keyVaultCodesignCertificateName,doNotSignApps,doNotRunTests,artifact,generateDependencyArtifact
- name: Read secrets
id: ReadSecrets
if: github.event_name != 'pull_request'
uses: microsoft/AL-Go-Actions/[email protected]
with:
shell: ${{ inputs.shell }}
gitHubSecrets: ${{ toJson(secrets) }}
getSecrets: '${{ inputs.secrets }},appDependencyProbingPathsSecrets,AZURE_CREDENTIALS'
- name: Determine ArtifactUrl
uses: microsoft/AL-Go-Actions/[email protected]
id: determineArtifactUrl
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}
- name: Cache Business Central Artifacts
if: env.useCompilerFolder == 'True' && inputs.useArtifactCache && env.artifactCacheKey
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .artifactcache
key: ${{ env.artifactCacheKey }}
- name: Download Project Dependencies
id: DownloadProjectDependencies
uses: microsoft/AL-Go-Actions/[email protected]
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}
buildMode: ${{ inputs.buildMode }}
projectsDependenciesJson: ${{ inputs.projectDependenciesJson }}
baselineWorkflowRunId: ${{ inputs.baselineWorkflowRunId }}
- name: Build
uses: microsoft/AL-Go-Actions/[email protected]
env:
Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}'
BuildMode: ${{ inputs.buildMode }}
with:
shell: ${{ inputs.shell }}
artifact: ${{ env.artifact }}
project: ${{ inputs.project }}
buildMode: ${{ inputs.buildMode }}
installAppsJson: ${{ steps.DownloadProjectDependencies.outputs.DownloadedApps }}
installTestAppsJson: ${{ steps.DownloadProjectDependencies.outputs.DownloadedTestApps }}
- name: Sign
if: inputs.signArtifacts && env.doNotSignApps == 'False' && env.keyVaultCodesignCertificateName != ''
id: sign
uses: microsoft/AL-Go-Actions/[email protected]
with:
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}'
pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app'
- name: Calculate Artifact names
id: calculateArtifactsNames
uses: microsoft/AL-Go-Actions/[email protected]
if: success() || failure()
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}
buildMode: ${{ inputs.buildMode }}
suffix: ${{ inputs.artifactsNameSuffix }}
- name: Upload thisbuild artifacts - apps
if: inputs.publishThisBuildArtifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildAppsArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/Apps/'
if-no-files-found: ignore
retention-days: 1
- name: Upload thisbuild artifacts - dependencies
if: inputs.publishThisBuildArtifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildDependenciesArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/Dependencies/'
if-no-files-found: ignore
retention-days: 1
- name: Upload thisbuild artifacts - test apps
if: inputs.publishThisBuildArtifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: ${{ steps.calculateArtifactsNames.outputs.ThisBuildTestAppsArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/TestApps/'
if-no-files-found: ignore
retention-days: 1
- name: Publish artifacts - apps
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: inputs.publishArtifacts
with:
name: ${{ steps.calculateArtifactsNames.outputs.AppsArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/Apps/'
if-no-files-found: ignore
- name: Publish artifacts - dependencies
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: inputs.publishArtifacts && env.generateDependencyArtifact == 'True'
with:
name: ${{ steps.calculateArtifactsNames.outputs.DependenciesArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/Dependencies/'
if-no-files-found: ignore
- name: Publish artifacts - test apps
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: inputs.publishArtifacts
with:
name: ${{ steps.calculateArtifactsNames.outputs.TestAppsArtifactsName }}
path: '${{ inputs.project }}/.buildartifacts/TestApps/'
if-no-files-found: ignore
- name: Publish artifacts - build output
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: (success() || failure()) && (hashFiles(format('{0}/BuildOutput.txt',inputs.project)) != '')
with:
name: ${{ steps.calculateArtifactsNames.outputs.BuildOutputArtifactsName }}
path: '${{ inputs.project }}/BuildOutput.txt'
if-no-files-found: ignore
- name: Publish artifacts - container event log
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: (failure()) && (hashFiles(format('{0}/ContainerEventLog.evtx',inputs.project)) != '')
with:
name: ${{ steps.calculateArtifactsNames.outputs.ContainerEventLogArtifactsName }}
path: '${{ inputs.project }}/ContainerEventLog.evtx'
if-no-files-found: ignore
- name: Publish artifacts - test results
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: (success() || failure()) && (hashFiles(format('{0}/TestResults.xml',inputs.project)) != '')
with:
name: ${{ steps.calculateArtifactsNames.outputs.TestResultsArtifactsName }}
path: '${{ inputs.project }}/TestResults.xml'
if-no-files-found: ignore
- name: Publish artifacts - bcpt test results
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
if: (success() || failure()) && (hashFiles(format('{0}/bcptTestResults.json',inputs.project)) != '')
with:
name: ${{ steps.calculateArtifactsNames.outputs.BcptTestResultsArtifactsName }}
path: '${{ inputs.project }}/bcptTestResults.json'
if-no-files-found: ignore
- name: Analyze Test Results
id: analyzeTestResults
if: (success() || failure()) && env.doNotRunTests == 'False'
uses: microsoft/AL-Go-Actions/[email protected]
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}
- name: Cleanup
if: always()
uses: microsoft/AL-Go-Actions/[email protected]
with:
shell: ${{ inputs.shell }}
project: ${{ inputs.project }}