1
+ name : Continuous Integration with Datadog
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened, ready_for_review]
6
+ push :
7
+ branches :
8
+ - main
9
+ - ' release/**'
10
+
11
+ permissions :
12
+ pull-requests : write
13
+ actions : read
14
+
15
+ concurrency :
16
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17
+ cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
18
+
19
+ env :
20
+ BUILD_ARTIFACT_NAME : ' lace-dev-${{ github.sha }}'
21
+
22
+ jobs :
23
+ datadog-ci :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : Setup Datadog CI
27
+ id : datadog-setup
28
+ uses : DataDog/github-action-dd-trace@v1
29
+ with :
30
+ api-key : ${{ secrets.DATADOG_API_KEY }}
31
+ site : datadoghq.com
32
+ service : lace-wallet
33
+ env : ci
34
+ tags : ci:true,service:lace-wallet,repo:lace
35
+
36
+ - name : Send CI metrics to Datadog
37
+ uses : DataDog/github-action-metrics@v1
38
+ with :
39
+ api-key : ${{ secrets.DATADOG_API_KEY }}
40
+ site : datadoghq.com
41
+ metrics : |
42
+ github.ci.pipeline.duration:${{ github.run_duration }}|#service:lace-wallet,env:ci,workflow:${{ github.workflow }},job:${{ github.job }}
43
+ github.ci.pipeline.status:1|#service:lace-wallet,env:ci,workflow:${{ github.workflow }},job:${{ github.job }},status:${{ job.status }}
44
+
45
+ prepare :
46
+ name : Prepare
47
+ runs-on : ubuntu-22.04
48
+ needs : [datadog-ci]
49
+
50
+ steps :
51
+ - name : Checkout repository
52
+ uses : actions/checkout@v4
53
+ with :
54
+ fetch-depth : 0
55
+
56
+ - name : Collect Workflow Telemetry Build Packages
57
+ uses : catchpoint/workflow-telemetry-action@v2
58
+ with :
59
+ comment_on_pr : false
60
+
61
+ - name : Setup Node.js and install dependencies
62
+ uses : ./.github/actions/install
63
+ with :
64
+ WALLET_PASSWORD : ${{ secrets.WALLET_PASSWORD_TESTNET }}
65
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
66
+
67
+ - name : Build common
68
+ uses : ./.github/actions/build/package
69
+ with :
70
+ DIR : packages/common
71
+ NAME : packages-common
72
+
73
+ - name : Build cardano
74
+ uses : ./.github/actions/build/package
75
+ with :
76
+ DIR : packages/cardano
77
+ NAME : packages-cardano
78
+
79
+ - name : Build translation
80
+ uses : ./.github/actions/build/package
81
+ with :
82
+ DIR : packages/translation
83
+ NAME : packages-translation
84
+
85
+ - name : Build core
86
+ uses : ./.github/actions/build/package
87
+ with :
88
+ DIR : packages/core
89
+ NAME : packages-core
90
+
91
+ - name : Build staking
92
+ uses : ./.github/actions/build/package
93
+ with :
94
+ DIR : packages/staking
95
+ NAME : packages-staking
96
+
97
+ - name : Build nami
98
+ uses : ./.github/actions/build/package
99
+ with :
100
+ DIR : packages/nami
101
+ NAME : packages-nami
102
+
103
+ - name : Build bitcoin
104
+ uses : ./.github/actions/build/package
105
+ with :
106
+ DIR : packages/bitcoin
107
+ NAME : packages-bitcoin
108
+
109
+ - name : Send build metrics to Datadog
110
+ run : |
111
+ curl -X POST "https://api.datadoghq.com/api/v1/series" \
112
+ -H "Content-Type: application/json" \
113
+ -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
114
+ -d '{
115
+ "series": [{
116
+ "metric": "lace.build.packages",
117
+ "points": [[$(date +%s), 7]],
118
+ "tags": ["service:lace-wallet", "env:ci", "workflow:prepare"],
119
+ "type": "gauge"
120
+ }]
121
+ }'
122
+
123
+ unitTests :
124
+ name : Unit tests
125
+ runs-on : ubuntu-22.04
126
+ needs : prepare
127
+
128
+ steps :
129
+ - name : Checkout repository
130
+ uses : actions/checkout@v4
131
+
132
+ - name : Setup Node.js and install dependencies
133
+ uses : ./.github/actions/install
134
+ with :
135
+ WALLET_PASSWORD : ${{ secrets.WALLET_PASSWORD_TESTNET }}
136
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
137
+
138
+ - name : Download packages-common
139
+ uses : actions/download-artifact@v4
140
+ with :
141
+ name : packages-common
142
+ path : packages/common/dist
143
+
144
+ - name : Download packages-cardano
145
+ uses : actions/download-artifact@v4
146
+ with :
147
+ name : packages-cardano
148
+ path : packages/cardano/dist
149
+
150
+ - name : Download packages-translation
151
+ uses : actions/download-artifact@v4
152
+ with :
153
+ name : packages-translation
154
+ path : packages/translation/dist
155
+
156
+ - name : Download packages-core
157
+ uses : actions/download-artifact@v4
158
+ with :
159
+ name : packages-core
160
+ path : packages/core/dist
161
+
162
+ - name : Download packages-staking
163
+ uses : actions/download-artifact@v4
164
+ with :
165
+ name : packages-staking
166
+ path : packages/staking/dist
167
+
168
+ - name : Download packages-nami
169
+ uses : actions/download-artifact@v4
170
+ with :
171
+ name : packages-nami
172
+ path : packages/nami/dist
173
+
174
+ - name : Download packages-bitcoin
175
+ uses : actions/download-artifact@v4
176
+ with :
177
+ name : packages-bitcoin
178
+ path : packages/bitcoin/dist
179
+
180
+ - name : Collect Workflow Telemetry Unit Tests
181
+ uses : catchpoint/workflow-telemetry-action@v2
182
+ with :
183
+ comment_on_pr : false
184
+
185
+ - name : Execute unit tests
186
+ uses : ./.github/actions/test/unit
187
+
188
+ - name : Send test metrics to Datadog
189
+ run : |
190
+ curl -X POST "https://api.datadoghq.com/api/v1/series" \
191
+ -H "Content-Type: application/json" \
192
+ -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
193
+ -d '{
194
+ "series": [{
195
+ "metric": "lace.tests.unit",
196
+ "points": [[$(date +%s), 1]],
197
+ "tags": ["service:lace-wallet", "env:ci", "workflow:unitTests", "status:${{ job.status }}"],
198
+ "type": "gauge"
199
+ }]
200
+ }'
201
+
202
+ release-pkg :
203
+ name : Release package
204
+ runs-on : ubuntu-22.04
205
+ needs : prepare
206
+
207
+ steps :
208
+ - name : Checkout repository
209
+ uses : actions/checkout@v4
210
+
211
+ - name : Setup Node.js and install dependencies
212
+ uses : ./.github/actions/install
213
+ with :
214
+ WALLET_PASSWORD : ${{ secrets.WALLET_PASSWORD_TESTNET }}
215
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
216
+
217
+ - name : Download packages-common
218
+ uses : actions/download-artifact@v4
219
+ with :
220
+ name : packages-common
221
+ path : packages/common/dist
222
+
223
+ - name : Download packages-cardano
224
+ uses : actions/download-artifact@v4
225
+ with :
226
+ name : packages-cardano
227
+ path : packages/cardano/dist
228
+
229
+ - name : Download packages-translation
230
+ uses : actions/download-artifact@v4
231
+ with :
232
+ name : packages-translation
233
+ path : packages/translation/dist
234
+
235
+ - name : Download packages-core
236
+ uses : actions/download-artifact@v4
237
+ with :
238
+ name : packages-core
239
+ path : packages/core/dist
240
+
241
+ - name : Download packages-staking
242
+ uses : actions/download-artifact@v4
243
+ with :
244
+ name : packages-staking
245
+ path : packages/staking/dist
246
+
247
+ - name : Download packages-nami
248
+ uses : actions/download-artifact@v4
249
+ with :
250
+ name : packages-nami
251
+ path : packages/nami/dist
252
+
253
+ - name : Download packages-bitcoin
254
+ uses : actions/download-artifact@v4
255
+ with :
256
+ name : packages-bitcoin
257
+ path : packages/bitcoin/dist
258
+
259
+ - name : Collect Workflow Telemetry Release Package
260
+ uses : catchpoint/workflow-telemetry-action@v2
261
+ with :
262
+ comment_on_pr : false
263
+
264
+ - name : Execute release package
265
+ uses : ./.github/actions/release/package
266
+
267
+ - name : Send release metrics to Datadog
268
+ run : |
269
+ curl -X POST "https://api.datadoghq.com/api/v1/series" \
270
+ -H "Content-Type: application/json" \
271
+ -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
272
+ -d '{
273
+ "series": [{
274
+ "metric": "lace.release.package",
275
+ "points": [[$(date +%s), 1]],
276
+ "tags": ["service:lace-wallet", "env:ci", "workflow:release-pkg", "status:${{ job.status }}"],
277
+ "type": "gauge"
278
+ }]
279
+ }'
280
+
281
+ datadog-final :
282
+ needs : [prepare, unitTests, release-pkg]
283
+ runs-on : ubuntu-latest
284
+ steps :
285
+ - name : Send final CI metrics to Datadog
286
+ run : |
287
+ curl -X POST "https://api.datadoghq.com/api/v1/events" \
288
+ -H "Content-Type: application/json" \
289
+ -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
290
+ -d '{
291
+ "title": "Lace CI Pipeline Complete",
292
+ "text": "All CI jobs completed for ${{ github.repository }}\nBranch: ${{ github.ref_name }}\nCommit: ${{ github.sha }}\nStatus: ${{ needs.prepare.result }}, ${{ needs.unitTests.result }}, ${{ needs.release-pkg.result }}",
293
+ "tags": ["service:lace-wallet", "env:ci", "workflow:ci", "repo:lace"],
294
+ "alert_type": "${{ needs.prepare.result == 'success' && needs.unitTests.result == 'success' && needs.release-pkg.result == 'success' && 'info' || 'error' }}",
295
+ "source_type_name": "github"
296
+ }'
0 commit comments