-
Notifications
You must be signed in to change notification settings - Fork 38
224 lines (213 loc) · 10.2 KB
/
Trgr InitDev workflows in Implementation repo.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
name: Trgr InitDev workflows in Implementation repo
on:
pull_request:
branches: [main, 'b-v*-patch*','feature-*']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
EDFI_ODS_IMP_TOKEN: ${{ secrets.REPO_DISPATCH_TOKEN }}
REPOSITORY_OWNER: ${{ GITHUB.REPOSITORY_OWNER }}
HEAD_REF: ${{ GITHUB.HEAD_REF }}
REF_NAME: ${{ GITHUB.REF_NAME }}
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check for Repo Dispatch Token
if: ${{ env.REPOSITORY_OWNER == 'Ed-Fi-Alliance-OSS' && env.EDFI_ODS_IMP_TOKEN == '' }}
run: |
echo "::error::Missing GitHub Token"
exit 1
- name: Setup .NET
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # 2.1.0
with:
dotnet-version: 6.0.x
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/
- name: Is pull request branch exists in Ed-Fi-ODS
working-directory: ./Ed-Fi-ODS/
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "."
- name: Checkout Ed-Fi-ODS-Implementation
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
path: Ed-Fi-ODS-Implementation/
- name: Is pull request branch exists in Ed-Fi-ODS-Implementation
working-directory: ./Ed-Fi-ODS/
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS-Implementation"
- name: Set Current Branch Environment Variable
shell: pwsh
run: |
$current_branch = '${{env.REF_NAME}}'
if ($current_branch -like "*/merge"){
$current_branch = '${{env.HEAD_REF}}'
}
Write-Host "Current Branch: $current_branch"
echo "current_branch=$current_branch" >> $Env:GITHUB_ENV
- name: Check Ed-Fi-ODS-Implementation Repo PR exists or not
shell: pwsh
run: |
$accessToken = "${{ env.EDFI_ODS_IMP_TOKEN }}"
$repositoryName = "Ed-Fi-ODS-Implementation"
$apiUrl = "https://api.github.com/repos/${{ env.REPOSITORY_OWNER }}/$repositoryName/pulls?state=open&head=${{ env.REPOSITORY_OWNER }}:${{ env.current_branch }}"
$headers = @{
Authorization = "Bearer $accessToken"
Accept = "application/vnd.github.v3+json"
}
$response = Invoke-WebRequest -Uri $apiUrl -Headers $headers
# Access x-ratelimit-limit and x-ratelimit-remaining from response headers
$rateLimitLimit = $response.Headers['X-RateLimit-Limit']
$rateLimitRemaining = $response.Headers['X-RateLimit-Remaining']
Write-Host "x-ratelimit-limit: $rateLimitLimit"
Write-Host "x-ratelimit-remaining: $rateLimitRemaining"
$jsonResponse = $response | ConvertFrom-Json
foreach ($pr in $jsonResponse) {
Write-Host "current branch: ${{ env.current_branch }}"
Write-Host "ref: $($pr.head.ref)"
if ($pr.head.ref -eq "${{ env.current_branch }}")
{
Write-Host "PR #$($pr.number): $($pr.head.label)"
echo "EXIT_STEP=true">> $env:GITHUB_ENV
}
}
- name: Check for EXIT_STEP Status
if: env.EXIT_STEP == 'true'
run: |
echo "::notice::Ed-Fi-ODS-Implementation already have same branch ${{ env.current_branch }} running all Initdev builds ,so Skipping this build"
echo "EXIT_STEP value is ${{ env.EXIT_STEP }}"
- name: Dispatch InitDev , Multitenancy workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevMultitenancy
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev, MultiTenancy.yml
workflow_timeout_seconds: 4800
- name: Dispatch InitDev, Smoke Tests workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevSmokeTests
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev, Smoke Tests.yml
workflow_timeout_seconds: 4800
- name: Dispatch InitDev, Unit tests, Integration tests, Package workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevUnittestsIntegrationtestsPackage
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev, Unit tests, Integration tests, Package.yml
workflow_timeout_seconds: 4800
- name: Dispatch InitDev Postgres, Multitenancy workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevPostgresMultitenancy
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev Postgres, MultiTenancy.yml
workflow_timeout_seconds: 4800
- name: Dispatch InitDev Postgres, Smoke Tests workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevPostgresSmokeTests
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev Postgres, Smoke Tests.yml
workflow_timeout_seconds: 4800
- name: Dispatch InitDev Postgres, Unit tests, Integration tests workflow
if: env.EXIT_STEP != 'true'
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_InitDevPostgresUnittestsIntegrationtests
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
ref: ${{ env.current_branch }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
workflow: InitDev Postgres, Unit tests, Integration tests.yml
workflow_timeout_seconds: 4800
- name: Await to complete the execution for InitDev , MultiTenancy RunID ${{ steps.return_dispatch_InitDevMultitenancy.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevMultitenancy.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000
- name: Await to complete the execution for InitDev, Smoke Tests RunID ${{ steps.return_dispatch_InitDevSmokeTests.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevSmokeTests.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000
- name: Await to complete the execution for InitDev, Unit tests, Integration tests, Package RunID ${{ steps.return_dispatch_InitDevUnittestsIntegrationtestsPackage.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevUnittestsIntegrationtestsPackage.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000
- name: Await to complete the execution for InitDev Postgres, MultiTenancy RunID ${{ steps.return_dispatch_InitDevPostgresMultitenancy.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevPostgresMultitenancy.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000
- name: Await to complete the execution for InitDev Postgres, Smoke Tests RunID ${{ steps.return_dispatch_InitDevPostgresSmokeTests.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevPostgresSmokeTests.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000
- name: Await to complete the execution for InitDev Postgres, Unit tests, Integration tests RunID ${{ steps.return_dispatch_InitDevPostgresUnittestsIntegrationtests.outputs.run_id }}
if: env.EXIT_STEP != 'true'
uses: codex-/await-remote-run@d04eeb1e053a19a32037eb0b8ddee6ab4f19790a #v1.7.0
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repo: Ed-Fi-ODS-Implementation
owner: ${{ github.repository_owner }}
run_id: ${{ steps.return_dispatch_InitDevPostgresUnittestsIntegrationtests.outputs.run_id }}
run_timeout_seconds: 4800
poll_interval_ms: 5000