-
Notifications
You must be signed in to change notification settings - Fork 2
196 lines (183 loc) Β· 5.52 KB
/
pull-request.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
name: Pull-Request
on:
pull_request:
jobs:
valgrind:
needs: ['cpp-lint', 'js-lint']
strategy:
matrix:
version: [16, 18, 19, 20, 21, 22, 23]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: sudo apt-get update && sudo apt-get install valgrind
- run: npm i --ignore-scripts
- run: npm run test:js-valgrind
asan:
needs: ['cpp-lint', 'js-lint']
strategy:
matrix:
version: [16, 18, 19, 20, 21, 22, 23]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: sudo apt-get update && sudo apt-get install libcpputest-dev cpputest
- run: npm i --ignore-scripts
- run: npm run test:asan
- run: npm run test:js-asan
build:
needs: ['cpp-lint', 'js-lint']
uses: Datadog/action-prebuildify/.github/workflows/build.yml@ugaitz/support-node-23
with:
cache: false
napi: false
package-manager: 'npm'
prebuild: 'node scripts/prebuild'
skip: 'linux-arm,linux-ia32'
target-name: 'iastnativemethods'
min-node-version: 16
cpp-test-libc:
needs: ['build']
runs-on: ubuntu-latest
permissions:
checks: write
strategy:
matrix:
debian:
- tag: testing
target:
- dockerfile: Dockerfile
libc: libc
artifact: linux-x64
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: docker build -t cpputest-libc --build-arg TAG=${{ matrix.debian.tag }} -f ./docker/${{ matrix.target.dockerfile }} .
- run: docker run --name test-libc cpputest-libc
- run: docker cp test-libc:/build/test/cpputest/results/ .
- uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/results/cpputest_*.xml'
check_name: junit test report ${{ matrix.target.name }}
cpp-test-musl:
needs: ['build']
runs-on: ubuntu-latest
permissions:
checks: write
strategy:
matrix:
alpine:
- tag: latest
target:
- dockerfile: alpine.Dockerfile
libc: musl
artifact: linuxmusl-x64
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: docker build -t cpputest-musl --build-arg TAG=${{ matrix.alpine.tag }} -f ./docker/${{ matrix.target.dockerfile }} .
- run: docker run --name test-musl cpputest-musl
- run: docker cp test-musl:/build/test/cpputest/results/ .
- uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/results/cpputest_*.xml'
check_name: junit test report ${{ matrix.target.name }}
cpp-lint:
needs: ['check-licenses']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- run: pip install cpplint
- run: cpplint --filter=-build/include_subdir,-whitespace/indent_namespace --linelength=120 --recursive ./src
js-lint:
needs: ['check-licenses']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm i --ignore-scripts
- run: npm run lint
check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm i --ignore-scripts
- run: node scripts/check_licenses.js
pack:
needs: ['cpp-test-musl', 'cpp-test-libc']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
- run: npm pack
- uses: codex-team/action-nodejs-package-info@v1
id: package
- uses: actions/upload-artifact@v4
with:
name: datadog-native-iast-taint-tracking-${{ steps.package.outputs.version }}
path: '*.tgz'
test-native-js:
needs: ['pack']
strategy:
matrix:
target:
- name: linux 64 bits
os: ubuntu-latest
artifact: linux-x64-gnu
- name: windows 64 bits
os: windows-2019
artifact: win32-x64-msvc
- name: macos 64 bits
os: macos-latest
artifact: darwin-x64
runs-on: ${{ matrix.target.os }}
permissions:
checks: write
env:
NPM_TAINTEDUTILS: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci --ignore-scripts
- run: npm install node-gyp
- uses: codex-team/action-nodejs-package-info@v1
id: package
- uses: actions/download-artifact@v4
with:
name: datadog-native-iast-taint-tracking-${{ steps.package.outputs.version }}
- run: npm i --verbose datadog-native-iast-taint-tracking-${{ steps.package.outputs.version }}.tgz
- run: npm run test:js-junit
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/junit.xml'
check_name: junit test report ${{ matrix.target.name }}
all-good:
needs:
- test-native-js
runs-on: ubuntu-latest
steps:
- run: echo 'πππππ'