Skip to content

Verify Installation #25

Verify Installation

Verify Installation #25

# 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, packagecloud'
type: choice
default: 'RubyGem'
options:
- RubyGem
- packagecloud
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
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