-
Notifications
You must be signed in to change notification settings - Fork 309
163 lines (151 loc) · 5.48 KB
/
project.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
name: Project
on:
pull_request:
push:
branches: [master]
schedule:
- cron: "0 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
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: [18, 20, 22, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-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: yarn test:integration
# We'll run these separately for earlier (i.e. unsupported) versions
integration-guardrails:
strategy:
matrix:
version: [12.0.0, 12, 14.0.0, 14, 16.0.0, 16, 18.0.0, 18.1.0, 20.0.0, 22.0.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js
integration-guardrails-unsupported:
strategy:
matrix:
version: ['0.8', '0.10', '0.12', '4', '6', '8', '10']
runs-on: ubuntu-latest
env:
DD_INJECTION_ENABLED: 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: node ./init
integration-ci:
strategy:
matrix:
version: [18, latest]
framework: [cucumber, playwright, selenium, jest, mocha]
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- name: Install Google Chrome
run: |
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
if [ $? -ne 0 ]; then echo "Failed to add Google key"; exit 1; fi
sudo apt-get update
sudo apt-get install -y google-chrome-stable
if [ $? -ne 0 ]; then echo "Failed to install Google Chrome"; exit 1; fi
if: ${{ matrix.framework == 'selenium' }}
- name: Install ChromeDriver
run: |
export CHROME_VERSION=$(google-chrome --version)
CHROME_DRIVER_DOWNLOAD_URL=$(node --experimental-fetch scripts/get-chrome-driver-download-url.js)
wget -q "$CHROME_DRIVER_DOWNLOAD_URL"
if [ $? -ne 0 ]; then echo "Failed to download ChromeDriver"; exit 1; fi
unzip chromedriver-linux64.zip
sudo mv chromedriver-linux64/chromedriver /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
if: ${{ matrix.framework == 'selenium' }}
- uses: ./.github/actions/install
- run: yarn test:integration:${{ matrix.framework }}
env:
NODE_OPTIONS: '-r ./ci/init'
integration-cypress:
strategy:
matrix:
# Important: This is outside the minimum supported version of dd-trace-js
# Node > 16 does not work with [email protected] (not even without our plugin)
# TODO: figure out what to do with this: we might have to deprecate support for [email protected]
version: [16, latest]
# 6.7.0 is the minimum version we support
cypress-version: [6.7.0, latest]
module-type: ['commonJS', 'esm']
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: yarn config set ignore-engines true
- run: yarn test:integration:cypress --ignore-engines
env:
CYPRESS_VERSION: ${{ matrix.cypress-version }}
NODE_OPTIONS: '-r ./ci/init'
CYPRESS_MODULE_TYPE: ${{ matrix.module-type }}
integration-vitest:
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- uses: actions/setup-node@v3
with:
node-version: 20
- run: yarn test:integration:vitest
env:
NODE_OPTIONS: '-r ./ci/init'
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- run: yarn lint
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node/setup
- uses: ./.github/actions/install
- run: yarn type:test
- run: yarn type:doc