-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: create composite workflow for aws e2e tests
- Loading branch information
supershal
committed
Nov 7, 2023
1 parent
37ac8de
commit 1e43528
Showing
2 changed files
with
180 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Runs AWS tests when pull request opened, repopened or synchronized | ||
name: Build AWS AMI | ||
description: "Common setup steps to create aws AMI" | ||
inputs: | ||
os: | ||
description: "Name of the operating system" | ||
required: true | ||
buildConfig: | ||
description: "Build configuation options" | ||
required: true | ||
registry_mirror_url: | ||
description: "Registry Mirror URL" | ||
required: true | ||
docker_username: | ||
description: "DockerHub username" | ||
required: true | ||
docker_password: | ||
description: "DockerHub password" | ||
required: true | ||
aws_runner_role_arn: | ||
description: "AWS role for runners to assume" | ||
required: true | ||
redhat_user: | ||
description: "RedHat username" | ||
redhat_password: | ||
description: "RedHat password" | ||
github_token: | ||
description: "Github token to use with workflow" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
cache: true | ||
|
||
- name: Setup buildkit | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ inputs.aws_runner_role_arn }} | ||
aws-region: us-west-2 | ||
|
||
- name: Login to dockerhub Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
|
||
- name: Login to D2iQ's Mirror Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.registry_mirror_url }} | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
|
||
- name: Run E2E test for ${{ inputs.os }} with ${{ inputs.buildConfig }} configuration | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: runE2e "${{ inputs.os }}" "${{ inputs.buildConfig }}" aws true | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github_token}} | ||
RHSM_USER: ${{ inputs.redhat_user }} | ||
RHSM_PASS: ${{ inputs.redhat_password }} | ||
|
||
- name: Run make destroy to clean up failed tests | ||
if: ${{ always() }} | ||
run: make infra.aws.destroy || true | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters