Avastancu/arc e2e test linux vm (#2285)

This commit is contained in:
Ava Stancu
2023-02-27 15:36:15 +01:00
committed by GitHub
parent 149cf47c83
commit 910269aa11
5 changed files with 193 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
name: 'E2E ARC Test Action'
description: 'Includes common arc installation, setup and test file run'
inputs:
github-token:
description: 'JWT generated with Github App inputs'
required: true
runs:
using: "composite"
steps:
- name: Install ARC
run: helm install arc --namespace "arc-systems" --create-namespace ./charts/actions-runner-controller-2
shell: bash
- name: Get datetime
# We are using this value further in the runner installation to avoid runner name collision that are a risk with hard coded values.
# A datetime including the 3 nanoseconds are a good option for this and also adds to readability and runner sorting if needed.
run: echo "DATE_TIME=$(date +'%Y-%m-%d-%H-%M-%S-%3N')" >> $GITHUB_ENV
shell: bash
- name: Install runners
run: |
helm install "arc-runner-${{ env.DATE_TIME }}" \
--namespace "arc-runners" \
--create-namespace \
--set githubConfigUrl="https://github.com/actions/actions-runner-controller" \
--set githubConfigSecret.github_token="${{ inputs.github-token }}" \
./charts/auto-scaling-runner-set \
--debug
kubectl get pods -A
shell: bash
- name: Test ARC scales pods up and down
run: |
export GITHUB_TOKEN="${{ inputs.github-token }}"
export DATE_TIME="${{ env.DATE_TIME }}"
go test ./test_e2e_arc -v
shell: bash

View File

@@ -1,4 +1,4 @@
name: ARC-REUSABLE-WORKFLOW
name: ARC Reusable Workflow
on:
workflow_dispatch:
inputs:

View File

@@ -0,0 +1,23 @@
name: CI ARC E2E Linux VM Test
on:
workflow_dispatch:
jobs:
setup-steps:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Create Kind cluster
run: |
PATH=$(go env GOPATH)/bin:$PATH
kind create cluster --name e2e-test
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db
with:
application_id: ${{ secrets.ACTIONS_ACCESS_APP_ID }}
application_private_key: ${{ secrets.ACTIONS_ACCESS_PK }}
- uses: ./.github/actions/e2e-arc-test
with:
github-token: ${{ steps.get_workflow_token.outputs.token }}