-
Notifications
You must be signed in to change notification settings - Fork 135
267 lines (236 loc) · 10.6 KB
/
component_prerelease_testing.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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: .. 🚧 Test pre-release
# 2 copy of packaging and canaries jobs required to split workflow path, but keep in the same component to reuse other jobs
# - packaging-tests-linux & packaging-tests-windows are almost the same
# - canaries-linux & canaries-windows are almost the same
on:
workflow_call:
secrets:
AWS_VPC_SUBNET:
required: true
CROWDSTRIKE_CLIENT_ID:
required: true
CROWDSTRIKE_CLIENT_SECRET:
required: true
CROWDSTRIKE_CUSTOMER_ID:
required: true
inputs:
TAG:
required: true
type: string
PLATFORM:
required: true
type: string
TAG_OR_UNIQUE_NAME:
required: true
type: string
env:
AWS_ASSUME_ROLE: 'arn:aws:iam::018789649883:role/caos-pipeline-oidc-infra-agent'
ANSIBLE_FORKS: 20
permissions:
id-token: write
jobs:
provision:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Provision instances ${{ inputs.PLATFORM }}
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "-C test/provision TERRAFORM_STATE_KEY=${{ inputs.TAG_OR_UNIQUE_NAME }} PREFIX=pkg-tests INVENTORY_OUTPUT=/srv/runner/inventory/${{ inputs.TAG_OR_UNIQUE_NAME }}-inventory.ec2 TAG_OR_UNIQUE_NAME=${{ inputs.TAG_OR_UNIQUE_NAME }} PLATFORM=${{ inputs.PLATFORM }} CROWDSTRIKE_CLIENT_ID=${{ secrets.CROWDSTRIKE_CLIENT_ID }} CROWDSTRIKE_CLIENT_SECRET=${{ secrets.CROWDSTRIKE_CLIENT_SECRET }} CROWDSTRIKE_CUSTOMER_ID=${{ secrets.CROWDSTRIKE_CUSTOMER_ID }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
log_filters: |
\[ALLOW_MSG\].+
TASK\s\[.*\]\s
PLAY\s\[.*\]\s
PLAY\sRECAP\s
Apply\scomplete!
ok=\d+\s+changed=\d+\s+unreachable=\d+\s+failed=\d+\s+skipped=\d+\s+rescued=\d+\s+ignored=\d+
harvest-tests:
needs: [ provision ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Launch harvest tests
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "test/automated/harvest PLATFORM=${{ inputs.PLATFORM }} ANSIBLE_FORKS=${{ env.ANSIBLE_FORKS }} ANSIBLE_INVENTORY_FOLDER=/srv/runner/inventory ANSIBLE_INVENTORY_FILE=${{ inputs.TAG_OR_UNIQUE_NAME }}-inventory.ec2 TAG=${{ inputs.TAG }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
packaging-tests-linux:
if: ${{ inputs.PLATFORM == 'linux' }}
strategy:
fail-fast: false # i.e. don't cancel amd64 if arm64 fails
matrix:
limit:
- "linux_amd64"
- "linux_arm64"
needs: [ harvest-tests ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
role-duration-seconds: 7200
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Launch packaging tests
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "test/automated/packaging LIMIT=${{ matrix.limit }} PLATFORM=${{ inputs.PLATFORM }} ANSIBLE_FORKS=${{ env.ANSIBLE_FORKS }} ANSIBLE_INVENTORY_FOLDER=/srv/runner/inventory ANSIBLE_INVENTORY_FILE=${{ inputs.TAG_OR_UNIQUE_NAME }}-inventory.ec2 TAG=${{ inputs.TAG }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
packaging-tests-windows:
if: ${{ inputs.PLATFORM == 'windows' }}
needs: [ harvest-tests ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Launch packaging tests
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "test/automated/packaging LIMIT=windows_amd64 PLATFORM=${{ inputs.PLATFORM }} ANSIBLE_FORKS=${{ env.ANSIBLE_FORKS }} ANSIBLE_INVENTORY_FOLDER=/srv/runner/inventory ANSIBLE_INVENTORY_FILE=${{ inputs.TAG_OR_UNIQUE_NAME }}-inventory.ec2 TAG=${{ inputs.TAG }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
provision-clean-linux:
if: ${{ inputs.PLATFORM == 'linux' }}
needs: [ packaging-tests-linux ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Clean instances ${{ inputs.PLATFORM }}
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "-C test/provision clean TERRAFORM_STATE_KEY=${{ inputs.TAG_OR_UNIQUE_NAME }} TAG_OR_UNIQUE_NAME=${{ inputs.TAG_OR_UNIQUE_NAME }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
log_filters: |
\[ALLOW_MSG\].+
TASK\s\[.*\]\s
PLAY\s\[.*\]\s
PLAY\sRECAP\s
Apply\scomplete!
ok=\d+\s+changed=\d+\s+unreachable=\d+\s+failed=\d+\s+skipped=\d+\s+rescued=\d+\s+ignored=\d+
provision-clean-windows:
if: ${{ inputs.PLATFORM == 'windows' }}
needs: [ packaging-tests-windows ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH=${GIT_BRANCH#refs/tags/}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Clean instances ${{ inputs.PLATFORM }}
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "-C test/provision clean TERRAFORM_STATE_KEY=${{ inputs.TAG_OR_UNIQUE_NAME }} TAG_OR_UNIQUE_NAME=${{ inputs.TAG_OR_UNIQUE_NAME }}"
ecs_cluster_name: caos_infra_agent
task_definition_name: infra-agent
cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent
cloud_watch_logs_stream_name: ecs/test-prerelease
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }}
repo_name: "newrelic/infrastructure-agent"
ref: "${{ env.GIT_BRANCH }}"
log_filters: |
\[ALLOW_MSG\].+
TASK\s\[.*\]\s
PLAY\s\[.*\]\s
PLAY\sRECAP\s
Apply\scomplete!
ok=\d+\s+changed=\d+\s+unreachable=\d+\s+failed=\d+\s+skipped=\d+\s+rescued=\d+\s+ignored=\d+