-
Notifications
You must be signed in to change notification settings - Fork 377
180 lines (180 loc) · 5.52 KB
/
test.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
# Please do NOT manually edit this file.
# This file is generated by 'bundle exec rake github:actions:test_template'
---
name: Unit Tests
'on':
push:
branches:
- master
- poc/**
schedule:
- cron: 0 7 * * *
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/master' }}"
jobs:
build-ruby-33:
runs-on: ubuntu-24.04
name: Build ruby-3.3
outputs:
ruby-33-batches: "${{ steps.set-batches.outputs.ruby-33-batches }}"
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.3
steps:
- uses: actions/checkout@v4
- run: bundle install
- uses: actions/upload-artifact@v4
with:
name: bundled-lockfile-ruby-33-${{ github.run_id }}
retention-days: 1
path: Gemfile.lock
- id: set-batches
run: |
batches_json=$(bundle exec rake github:generate_batches)
# Debug output
echo "Generated JSON:"
echo "$batches_json"
# Set the output
echo "ruby-33-batches=$batches_json" >> $GITHUB_OUTPUT
- run: bundle exec rake dependency:install
- uses: actions/upload-artifact@v4
with:
name: bundled-dependencies-ruby-33-${{ github.run_id }}
retention-days: 1
path: "/usr/local/bundle"
test-ruby-33:
needs:
- build-ruby-33
runs-on: ubuntu-24.04
name: Test ruby-3.3[${{ matrix.batch }}]
strategy:
fail-fast: false
matrix:
include: "${{ fromJson(needs.build-ruby-33.outputs.ruby-33-batches).include }}"
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.3
env:
TEST_POSTGRES_HOST: postgres
TEST_REDIS_HOST: redis
services:
postgres:
image: postgres:9.6
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
redis:
image: redis:6.2
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/download-artifact@v4
with:
name: bundled-lockfile-ruby-33-${{ github.run_id }}
- uses: actions/download-artifact@v4
with:
name: bundled-dependencies-ruby-33-${{ github.run_id }}
path: "/usr/local/bundle"
- run: bundle install
- name: Run batched tests
timeout-minutes: 30
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
run: bundle exec rake github:run_batch_tests
- if: "${{ env.RUNNER_DEBUG == '1' && failure() }}"
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
build-jruby-94:
runs-on: ubuntu-24.04
name: Build jruby-9.4
outputs:
jruby-94-batches: "${{ steps.set-batches.outputs.jruby-94-batches }}"
container:
image: ghcr.io/datadog/images-rb/engines/jruby:9.4
steps:
- uses: actions/checkout@v4
- run: bundle install
- uses: actions/upload-artifact@v4
with:
name: bundled-lockfile-jruby-94-${{ github.run_id }}
retention-days: 1
path: Gemfile.lock
- id: set-batches
run: |
batches_json=$(bundle exec rake github:generate_batches)
# Debug output
echo "Generated JSON:"
echo "$batches_json"
# Set the output
echo "jruby-94-batches=$batches_json" >> $GITHUB_OUTPUT
- run: bundle exec rake dependency:install
- uses: actions/upload-artifact@v4
with:
name: bundled-dependencies-jruby-94-${{ github.run_id }}
retention-days: 1
path: "/usr/local/bundle"
test-jruby-94:
needs:
- build-jruby-94
runs-on: ubuntu-24.04
name: Test jruby-9.4[${{ matrix.batch }}]
strategy:
fail-fast: false
matrix:
include: "${{ fromJson(needs.build-jruby-94.outputs.jruby-94-batches).include }}"
container:
image: ghcr.io/datadog/images-rb/engines/jruby:9.4
env:
TEST_POSTGRES_HOST: postgres
TEST_REDIS_HOST: redis
services:
postgres:
image: postgres:9.6
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
redis:
image: redis:6.2
credentials:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/download-artifact@v4
with:
name: bundled-lockfile-jruby-94-${{ github.run_id }}
- uses: actions/download-artifact@v4
with:
name: bundled-dependencies-jruby-94-${{ github.run_id }}
path: "/usr/local/bundle"
- run: bundle install
- name: Run batched tests
timeout-minutes: 30
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
run: bundle exec rake github:run_batch_tests
- if: "${{ env.RUNNER_DEBUG == '1' && failure() }}"
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
aggregate:
runs-on: ubuntu-24.04
needs:
- test-ruby-33
- test-jruby-94
steps:
- run: echo "DONE!"