-
Notifications
You must be signed in to change notification settings - Fork 401
250 lines (231 loc) · 5.94 KB
/
test.yml
File metadata and controls
250 lines (231 loc) · 5.94 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: Unit Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- master
# A workaround to trigger the workflow for pull requests from forked repository,
# which does not have access to secrets.
#
# This is also useful for testing the workflow without opening a pull request.
- tmp/*
pull_request:
branches:
- master
schedule:
- cron: 0 */4 * * 1-5
- cron: 0 3 * * 0,6
# Default permissions for all jobs
permissions: {}
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/master' }}"
jobs:
# ADD NEW RUBIES HERE
ruby-40:
name: "Ruby 4.0"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "4.0"
alias: ruby-40
ruby-34:
name: "Ruby 3.4"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "3.4"
alias: ruby-34
ruby-33:
name: "Ruby 3.3"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "3.3"
alias: ruby-33
ruby-32:
name: "Ruby 3.2"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "3.2"
alias: ruby-32
ruby-31:
name: "Ruby 3.1"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "3.1"
alias: ruby-31
ruby-30:
name: "Ruby 3.0"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "3.0"
alias: ruby-30
ruby-27:
name: "Ruby 2.7"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "2.7"
alias: ruby-27
ruby-26:
name: "Ruby 2.6"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "2.6"
alias: ruby-26
ruby-25:
name: "Ruby 2.5"
uses: ./.github/workflows/_unit_test.yml
with:
engine: ruby
version: "2.5"
alias: ruby-25
jruby-100:
name: "JRuby 10.0"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "10.0"
alias: jruby-100
jruby-94:
name: "JRuby 9.4"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.4"
alias: jruby-94
jruby-93:
name: "JRuby 9.3"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.3"
alias: jruby-93
jruby-92:
name: "JRuby 9.2"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.2"
alias: jruby-92
junit:
name: dd/junit
if: ${{ !cancelled() }}
runs-on: ubuntu-24.04
container:
image: datadog/ci:v3.7.1
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DD_ENV: ci
DATADOG_SITE: datadoghq.com
DD_SERVICE: dd-trace-rb
DD_GIT_REPOSITORY_URL: "${{ github.repositoryUrl }}"
needs:
# ADD NEW RUBIES HERE
- ruby-40
- ruby-34
- ruby-33
- ruby-32
- ruby-31
- ruby-30
- ruby-27
- ruby-26
- ruby-25
- jruby-100
- jruby-94
- jruby-93
- jruby-92
steps:
- run: mkdir -p tmp/rspec && datadog-ci version
- name: Download all junit reports
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
path: tmp/rspec
pattern: junit-*
merge-multiple: true
- name: Format file paths
run: sed -i 's;file="./;file=";g' tmp/rspec/*.xml
# Note that GITHUB_SHA for this event is the last merge commit of the pull request merge branch,
# which `datadog-ci` failed to sync the correct git metadata in Github Actions.
#
# This causes the CODEOWNERS data being lost.
#
# This is a workaround to manually set the correct git commit sha for the pull request event.
- if: github.event_name == 'pull_request'
env:
DD_GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "DD_GIT_COMMIT_SHA=$DD_GIT_COMMIT_SHA" >> "$GITHUB_ENV"
- if: github.event_name != 'pull_request'
env:
DD_GIT_COMMIT_SHA: ${{ github.sha }}
run: echo "DD_GIT_COMMIT_SHA=$DD_GIT_COMMIT_SHA" >> "$GITHUB_ENV"
- run: echo "$DD_GIT_COMMIT_SHA"
- name: Upload junit reports
continue-on-error: true
run: datadog-ci junit upload --verbose tmp/rspec/
coverage:
name: dd/coverage
runs-on: ubuntu-24.04
needs:
# ADD NEW RUBIES HERE
- ruby-40
- ruby-34
- ruby-33
- ruby-32
- ruby-31
- ruby-30
- ruby-27
- ruby-26
- ruby-25
- jruby-100
- jruby-94
- jruby-93
- jruby-92
container:
image: datadog/ci:v3.20.0
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DD_ENV: ci
DATADOG_SITE: datadoghq.com
DD_SERVICE: dd-trace-rb
DD_GIT_REPOSITORY_URL: "${{ github.repositoryUrl }}"
steps:
- run: mkdir -p tmp/coverage && datadog-ci version
- name: Download all coverage data
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
path: tmp/coverage
pattern: coverage-*
merge-multiple: true
- name: Upload coverage reports to Datadog
run: datadog-ci coverage upload --verbose tmp/coverage/
complete:
name: Unit Tests (complete)
runs-on: ubuntu-24.04
needs:
# ADD NEW RUBIES HERE
- ruby-40
- ruby-34
- ruby-33
- ruby-32
- ruby-31
- ruby-30
- ruby-27
- ruby-26
- ruby-25
- jruby-100
- jruby-94
- jruby-93
- jruby-92
steps:
- run: echo "DONE!"