-
Notifications
You must be signed in to change notification settings - Fork 3
147 lines (134 loc) · 4.7 KB
/
verify_install.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
# Copyright (c) 2023 SolarWinds, LLC.
# All rights reserved.
name: Verify Installation
on:
workflow_dispatch:
inputs:
install-registry:
required: true
description: 'Registry used for install tests, e.g. RubyGem, GitHub'
type: choice
default: 'RubyGem'
options:
- RubyGem
- GitHub
solarwinds-version:
required: true
description: 'Solarwinds apm version'
env:
SW_APM_SERVICE_KEY: ${{ secrets.APM_RUBY_INSTALL_TESTING_SWO_KEY }}
SW_APM_COLLECTOR: apm.collector.cloud.solarwinds.com
MODE: ${{ github.event.inputs.install-registry }}
SOLARWINDS_APM_VERSION: ${{ github.event.inputs.solarwinds-version }}
jobs:
start_arm64_runner:
outputs:
matrix: ${{ steps.launch.outputs.matrix }} # this will be a json object mapping identifiers to labels and instance ids
runs-on: ubuntu-latest
steps:
- uses: getsentry/action-github-app-token@v2
id: github-token
with:
app_id: ${{ vars.APPLICATION_ID }}
private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.CI_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- id: launch
uses: solarwindscloud/ec2-runner-action@main
with:
action: launch
matrix: | # one identifier per line
ruby:3.0.6-alpine3.16
ruby:3.0.6-slim-bullseye
ruby:3.2.2-alpine3.17
ruby:3.2.2-slim-bullseye
amazonlinux:2
amazonlinux:2023
ubuntu:22.04
github-token: ${{ steps.github-token.outputs.token }}
runner-user: github
runner-directory: /gh
instance-type: t4g.medium
ami-name: gha-arm64-ubuntu22-.*
ami-owner: "858939916050"
subnet-id: subnet-0fd499f8a50e41807
security-group-ids: sg-0fd8d8cd6effda4a5
tags: |
Name=xuan-cao-ec2-runner
verify_installation:
needs:
- start_arm64_runner
strategy:
fail-fast: false
matrix:
hostname:
- rb3.0.6-alpine3.16
- rb3.0.6-slim-bullseye
- rb3.2.2-alpine3.17
- rb3.2.2-slim-bullseye
- rb3.1.0-amazlinux2
- rb3.1.0-amazlinux2023
- rb3.0.2-ubuntu2204
arch:
- x64
- arm64
include:
- hostname: rb3.0.6-alpine3.16
image: ruby:3.0.6-alpine3.16
- hostname: rb3.0.6-slim-bullseye
image: ruby:3.0.6-slim-bullseye
- hostname: rb3.2.2-alpine3.17
image: ruby:3.2.2-alpine3.17
- hostname: rb3.2.2-slim-bullseye
image: ruby:3.2.2-slim-bullseye
- hostname: rb3.1.0-amazlinux2
image: amazonlinux:2
- hostname: rb3.1.0-amazlinux2023
image: amazonlinux:2023
- hostname: rb3.0.2-ubuntu2204
image: ubuntu:22.04
exclude:
# alpine not yet supported on self-hosted runners https://github.com/actions/runner/issues/801
- hostname: rb3.0.6-alpine3.16
arch: arm64
- hostname: rb3.2.2-alpine3.17
arch: arm64
runs-on: ${{ matrix.arch == 'arm64' && fromJSON(needs.start_arm64_runner.outputs.matrix)[matrix.image].label || 'ubuntu-latest' }}
container:
image: "${{ matrix.image }}"
options: --hostname "${{ matrix.hostname }}"
steps:
- if: ${{ startsWith(matrix.image, 'amazonlinux') }}
run: yum install -y tar gzip
- uses: actions/checkout@v3
- name: Verify install
working-directory: .github/workflows/scripts
run: ./verify_install.sh
shell: sh
env:
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }}
terminate_arm64_runner:
if: ${{ always() }}
needs:
- start_arm64_runner
- verify_installation
runs-on: ubuntu-latest
steps:
- uses: getsentry/action-github-app-token@v2
id: github-token
with:
app_id: ${{ vars.APPLICATION_ID }}
private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.CI_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: solarwindscloud/ec2-runner-action@main
with:
action: terminate
github-token: ${{ steps.github-token.outputs.token }}
matrix: ${{ needs.start_arm64_runner.outputs.matrix }} # passing a matrix will terminate all runners, not just one