1
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
- - ' test/**'
11
- - ' feature/**'
12
- workflow_dispatch :
13
-
14
- permissions :
15
- pull-requests : write
16
- actions : read
17
-
18
- concurrency :
19
- group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20
- cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
21
-
22
- env :
23
- BUILD_ARTIFACT_NAME : ' lace-dev-${{ github.sha }}'
24
-
25
- jobs :
26
- datadog-ci :
27
- runs-on : ubuntu-latest
28
- steps :
29
- - name : Send CI metrics to Datadog
30
- run : |
31
- if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
32
- echo "Sending metrics to Datadog..."
33
- response=$(curl -s -w "%{http_code}" -X POST "https://api.datadoghq.com/api/v1/series" \
34
- -H "Content-Type: application/json" \
35
- -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
36
- -d '{
37
- "series": [{
38
- "metric": "github.ci.pipeline.duration",
39
- "points": [[$(date +%s), ${{ github.run_duration }}]],
40
- "tags": ["service:lace-wallet", "env:ci", "workflow:${{ github.workflow }}", "job:${{ github.job }}"],
41
- "type": "gauge"
42
- }, {
43
- "metric": "github.ci.pipeline.status",
44
- "points": [[$(date +%s), 1]],
45
- "tags": ["service:lace-wallet", "env:ci", "workflow:${{ github.workflow }}", "job:${{ github.job }}", "status:${{ job.status }}"],
46
- "type": "gauge"
47
- }]
48
- }')
49
- echo "Datadog API response: $response"
50
- else
51
- echo "No DATADOG_API_KEY provided, skipping metrics"
52
- fi
53
-
54
- prepare :
55
- name : Prepare
56
- runs-on : ubuntu-22.04
57
- needs : [datadog-ci]
58
-
59
- steps :
60
- - name : Checkout repository
61
- uses : actions/checkout@v4
62
- with :
63
- fetch-depth : 0
64
-
65
- - name : Collect Workflow Telemetry Build Packages
66
- uses : catchpoint/workflow-telemetry-action@v2
67
- with :
68
- comment_on_pr : false
69
-
70
- - name : Setup Node.js and install dependencies
71
- uses : ./.github/actions/install
72
- with :
73
- WALLET_PASSWORD : ${{ secrets.WALLET_PASSWORD_TESTNET }}
74
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
75
-
76
- - name : Build common
77
- uses : ./.github/actions/build/package
78
- with :
79
- DIR : packages/common
80
- NAME : packages-common
81
-
82
- - name : Build cardano
83
- uses : ./.github/actions/build/package
84
- with :
85
- DIR : packages/cardano
86
- NAME : packages-cardano
87
-
88
- - name : Build translation
89
- uses : ./.github/actions/build/package
90
- with :
91
- DIR : packages/translation
92
- NAME : packages-translation
93
-
94
- - name : Build core
95
- uses : ./.github/actions/build/package
96
- with :
97
- DIR : packages/core
98
- NAME : packages-core
99
-
100
- - name : Build staking
101
- uses : ./.github/actions/build/package
102
- with :
103
- DIR : packages/staking
104
- NAME : packages-staking
105
-
106
- - name : Build nami
107
- uses : ./.github/actions/build/package
108
- with :
109
- DIR : packages/nami
110
- NAME : packages-nami
111
-
112
- - name : Build bitcoin
113
- uses : ./.github/actions/build/package
114
- with :
115
- DIR : packages/bitcoin
116
- NAME : packages-bitcoin
117
-
118
- - name : Send build metrics to Datadog
119
- run : |
120
- if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
121
- echo "Sending build metrics to Datadog..."
122
- response=$(curl -s -w "%{http_code}" -X POST "https://api.datadoghq.com/api/v1/series" \
123
- -H "Content-Type: application/json" \
124
- -H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
125
- -d '{
126
- "series": [{
127
- "metric": "lace.build.packages",
128
- "points": [[$(date +%s), 7]],
129
- "tags": ["service:lace-wallet", "env:ci", "workflow:prepare"],
130
- "type": "gauge"
131
- }]
132
- }')
133
- echo "Datadog API response: $response"
134
- else
135
- echo "No DATADOG_API_KEY provided, skipping build metrics"
136
- fi
137
-
138
- unitTests :
139
- name : Unit tests
140
- runs-on : ubuntu-22.04
141
- needs : prepare
142
-
143
- steps :
144
- - name : Checkout repository
145
- uses : actions/checkout@v4
146
-
147
- - name : Setup Node.js and install dependencies
148
- uses : ./.github/actions/install
149
- with :
150
- WALLET_PASSWORD : ${{ secrets.WALLET_PASSWORD_TESTNET }}
151
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
152
-
153
- - name : Download packages-common
154
- uses : actions/download-artifact@v4
155
- with :
156
- name : packages-common
157
- path : packages/common/dist
158
-
159
- - name : Download packages-cardano
160
- uses : actions/download-artifact@v4
161
- with :
162
- name : packages-cardano
163
- path : packages/cardano/dist
164
-
165
- - name : Download packages-translation
166
- uses : actions/download-artifact@v4
167
- with :
168
- name : packages-translation
169
- path : packages/translation/dist
170
-
171
- - name : Download packages-core
172
- uses : actions/download-artifact@v4
173
- with :
174
- name : packages-core
175
- path : packages/core/dist
176
-
177
- - name : Download packages-staking
178
- uses : actions/download-artifact@v4
179
- with :
180
- name : packages-staking
181
- path : packages/staking/dist
182
-
183
- - name : Download packages-nami
184
- uses : actions/download-artifact@v4
185
- with :
186
- name : packages-nami
187
- path : packages/nami/dist
188
-
189
- - name : Download packages-bitcoin
190
- uses : actions/download-artifact@v4
191
- with :
192
- name : packages-bitcoin
193
- path : packages/bitcoin/dist
194
-
195
- - name : Collect Workflow Telemetry Unit Tests
196
- uses : catchpoint/workflow-telemetry-action@v2
197
- with :
198
- comment_on_pr : false
199
-
200
- - name : Execute unit tests
201
- uses : ./.github/actions/test/unit
202
-
203
- - name : Send test metrics to Datadog
204
- run : |
205
- if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
206
- echo "Sending test metrics to Datadog..."
207
- response=$(curl -s -w "%{http_code}" -X POST "https://api.datadoghq.com/api/v1/series" \
208
- -H "Content-Type: application/json" \
209
2
-H "DD-API-KEY : ${{ secrets.DATADOG_API_KEY }}" \
210
3
-d '{
211
4
" series " : [{
@@ -307,7 +100,7 @@ jobs:
307
100
run : |
308
101
if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
309
102
echo "Sending release metrics to Datadog..."
310
- response=$(curl -s -w "%{http_code}" -X POST "https://api.datadoghq.com/api/v1/series" \
103
+ response=$(curl -s -w "%{http_code}" -X POST "https://api.us5. datadoghq.com/api/v1/series" \
311
104
-H "Content-Type: application/json" \
312
105
-H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
313
106
-d '{
@@ -331,7 +124,7 @@ jobs:
331
124
run : |
332
125
if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
333
126
echo "Sending final metrics to Datadog..."
334
- response=$(curl -s -w "%{http_code}" -X POST "https://api.datadoghq.com/api/v1/events" \
127
+ response=$(curl -s -w "%{http_code}" -X POST "https://api.us5. datadoghq.com/api/v1/events" \
335
128
-H "Content-Type: application/json" \
336
129
-H "DD-API-KEY: ${{ secrets.DATADOG_API_KEY }}" \
337
130
-d '{
0 commit comments