-
Notifications
You must be signed in to change notification settings - Fork 407
250 lines (235 loc) · 8.44 KB
/
Copy pathplatform.yml
File metadata and controls
250 lines (235 loc) · 8.44 KB
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
name: Platform
on:
pull_request:
push:
branches: [master, mq-working-branch-master-*]
schedule:
- cron: 0 4 * * *
workflow_dispatch:
inputs:
latest-version:
description: "Node version to use"
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ inputs.latest-version }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }}
cancel-in-progress: true
env:
LATEST_VERSION: ${{ inputs.latest-version }}
# TODO: upstream jobs
jobs:
package-manager:
strategy:
fail-fast: false
matrix:
manager:
- name: npm
install: npm install
- name: pnpm
install: >-
pnpm
--allow-build=@datadog/native-appsec
--allow-build=@datadog/native-iast-taint-tracking
--allow-build=@datadog/native-metrics
--allow-build=@datadog/pprof
--allow-build=dd-trace
add
- name: yarn
install: yarn add
- name: yarn-berry
install: >-
(command -v corepack >/dev/null 2>&1 || npm install -g corepack)
&& yarn set version stable
&& yarn config set nodeLinker node-modules
&& yarn config set enableScripts true
&& yarn config set --json npmPreapprovedPackages '["@datadog/*","import-in-the-middle"]'
&& yarn add
- name: bun
install: bun add --linker=hoisted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
- run: FILENAME=$(npm pack --silent --pack-destination /tmp) && mv "/tmp/$FILENAME" /tmp/dd-trace.tgz
- run: mkdir -p /tmp/app
- run: npm i -g pnpm
if: matrix.manager.name == 'pnpm'
- run: cd /tmp/app && ${{ matrix.manager.install }} /tmp/dd-trace.tgz
- run: echo "require('dd-trace').init()" >> /tmp/app/index.js
- run: node /tmp/app
bun-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
- run: mkdir npm bun
- run: FILENAME=$(npm pack --silent) && tar -zxf "$FILENAME" -C npm
- run: ./node_modules/.bin/bun pm pack --gzip-level 0 --filename bun.tgz && tar -zxf bun.tgz -C bun
- run: diff -r npm bun
bun-runtime:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
- run: npm run test:integration:bun
- uses: ./.github/actions/upload-junit-artifacts
if: always()
with:
id: ${{ github.job }}
core:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: ./.github/actions/install
- run: npm run test:core:ci
- uses: ./.github/actions/node/latest
- run: npm run test:core:ci
- uses: ./.github/actions/coverage
with:
flags: platform-core
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}
dd-trace-api:
runs-on: ubuntu-latest
permissions:
id-token: write
env:
PLUGINS: dd-trace-api
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/plugins/test
# TODO: Split this up as it runs tests for multiple different teams.
integration:
strategy:
# when one version fails, say 14, all the other versions are stopped
# setting fail-fast to false in an attempt to prevent this from happening
fail-fast: false
matrix:
version: [oldest, maintenance, active, latest]
name: ${{ github.workflow }} / integration (node-${{ matrix.version }})
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
# Disable core dumps since some integration tests intentionally abort and core dump generation takes around 5-10s
- uses: ./.github/actions/install
- run: sudo sysctl -w kernel.core_pattern='|/bin/false'
- run: npm run test:integration:coverage
- uses: ./.github/actions/coverage
with:
flags: platform-integration-${{ matrix.version }}
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}-${{ strategy.job-index }}
crashtracking:
strategy:
fail-fast: false
matrix:
version: [oldest, maintenance, active, latest]
name: ${{ github.workflow }} / crashtracking (node-${{ matrix.version }})
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
- uses: ./.github/actions/install
# Disable core dumps since crashtracking tests intentionally abort
- run: sudo sysctl -w kernel.core_pattern='|/bin/false'
- run: npm run test:integration:crashtracking
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}-${{ strategy.job-index }}
unit-guardrails:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
- run: npm run test:trace:guardrails:ci
- uses: ./.github/actions/coverage
with:
flags: platform-unit-guardrails
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}
# We'll run these separately for earlier (i.e. unsupported) versions
integration-guardrails:
strategy:
fail-fast: false
matrix:
version: [16.0.0, 18.0.0, 20.0.0, 22.0.0, 24.0.0, 25]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
- run: bun add --linker=hoisted --ignore-scripts mocha@10 # Use older mocha to support old Node.js versions
- run: bun add --linker=hoisted --ignore-scripts express@4 # Use older express to support old Node.js versions
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
- run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}-${{ strategy.job-index }}
integration-guardrails-unsupported:
strategy:
fail-fast: false
matrix:
version:
["0.8", "0.10", "0.12", "4", "6", "8", "10", "12", "14.0.0", "14"]
runs-on: ubuntu-latest
env:
DD_TRACE_DEBUG: "true" # This exercises more of the guardrails code
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
- run: node ./init
- run: node ./init
env:
DD_INJECTION_ENABLED: "true"
shimmer:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: ./.github/actions/install
- run: npm run test:shimmer:ci
- uses: ./.github/actions/node/latest
- run: npm run test:shimmer:ci
- uses: ./.github/actions/coverage
with:
flags: platform-shimmer
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}