generated from microsoft/AL-Go-PTE
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (109 loc) · 4.27 KB
/
Current.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
name: Test Current
on:
workflow_dispatch:
defaults:
run:
shell: PowerShell
jobs:
Initialization:
runs-on: [ windows-latest ]
outputs:
telemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
settings: ${{ steps.ReadSettings.outputs.SettingsJson }}
projects: ${{ steps.ReadSettings.outputs.ProjectsJson }}
projectCount: ${{ steps.ReadSettings.outputs.ProjectCount }}
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Initialize the workflow
id: init
uses: microsoft/AL-Go-Actions/WorkflowInitialize@v1.2
with:
eventId: "DO0101"
- name: Read settings
id: ReadSettings
uses: microsoft/AL-Go-Actions/ReadSettings@v1.2
with:
parentTelemetryScopeJson: ${{ steps.init.outputs.telemetryScopeJson }}
getProjects: 'Y'
Build:
needs: [ Initialization ]
runs-on: ${{ fromJson(needs.Initialization.outputs.githubRunner) }}
strategy:
matrix:
project: ${{ fromJson(needs.Initialization.outputs.projects) }}
fail-fast: false
name: Build ${{ matrix.project }}
outputs:
TestResultsArtifactsName: ${{ steps.calculateArtifactNames.outputs.TestResultsArtifactsName }}
BuildOutputArtifactsName: ${{ steps.calculateArtifactNames.outputs.BuildOutputArtifactsName }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read settings
uses: microsoft/AL-Go-Actions/ReadSettings@v1.2
with:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
project: ${{ matrix.project }}
- name: Read secrets
uses: microsoft/AL-Go-Actions/ReadSecrets@v1.2
env:
secrets: ${{ toJson(secrets) }}
with:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
settingsJson: ${{ env.Settings }}
secrets: 'licenseFileUrl,insiderSasToken,CodeSignCertificateUrl,CodeSignCertificatePassword,KeyVaultCertificateUrl,KeyVaultCertificatePassword,KeyVaultClientId'
- name: Run pipeline
uses: microsoft/AL-Go-Actions/RunPipeline@v1.2
with:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
Project: ${{ matrix.project }}
settingsJson: ${{ env.Settings }}
SecretsJson: ${{ env.RepoSecrets }}
- name: Calculate Artifact names
id: calculateArtifactNames
if: success() || failure()
run: |
$settings = '${{ env.Settings }}' | ConvertFrom-Json
$project = '${{ matrix.project }}'
if ($project -eq ".") { $project = $settings.RepoName }
'TestResults','BuildOutput' | ForEach-Object {
$name = "$($_)ArtifactsName"
$value = "$project-$_-Current-$([DateTime]::UtcNow.ToString('yyyyMMdd'))"
Write-Host "::set-output name=$name::$value"
Add-Content -Path $env:GITHUB_ENV -Value "$name=$value"
}
- name: Publish artifacts - build output
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: ${{ env.buildOutputArtifactsName }}
path: '${{ matrix.project }}/BuildOutput.txt'
if-no-files-found: ignore
- name: Publish artifacts - test results
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: ${{ env.testResultsArtifactsName }}
path: '${{ matrix.project }}/TestResults.xml'
if-no-files-found: ignore
- name: Cleanup
if: always()
uses: microsoft/AL-Go-Actions/PipelineCleanup@v1.2
with:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
Project: ${{ matrix.project }}
PostProcess:
if: always()
runs-on: [ windows-latest ]
needs: [ Initialization, Build ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Finalize the workflow
id: PostProcess
uses: microsoft/AL-Go-Actions/WorkflowPostProcess@v1.2
with:
eventId: "DO0101"
telemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}