Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Jul 19, 2024
1 parent 64e0be7 commit 0b6cb83
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 41 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/build-and-upload-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,31 +92,31 @@ jobs:
with:
tag: ${{ inputs.tag }}

# push-release-ecr:
# if: ${{ inputs.release }}
# needs: e2e-test
# permissions:
# id-token: write
# contents: read
# runs-on: ubuntu-latest
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
# aws-region: us-west-2 # Uploads only to us-west-2 for now
#
# - name: Login ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
#
# - name: Push image to release ECR
# run: |
# docker buildx imagetools create \
# -t ${{ env.ECR_OPERATOR_RELEASE_IMAGE }} \
# ${{ env.ECR_OPERATOR_STAGING_REPO }}:${{ inputs.tag }}
push-release-ecr:
if: ${{ inputs.release }}
needs: e2e-test
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-west-2 # Uploads only to us-west-2 for now

- name: Login ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Push image to release ECR
run: |
docker buildx imagetools create \
-t ${{ env.ECR_OPERATOR_RELEASE_IMAGE }} \
${{ env.ECR_OPERATOR_STAGING_REPO }}:${{ inputs.tag }}
70 changes: 57 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,70 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

name: Build and Upload Integration Test Artifact
name: Test
env:
# Use terraform assume role for uploading to ecr
AWS_ASSUME_ROLE: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
ECR_OPERATOR_STAGING_REPO: ${{ vars.ECR_OPERATOR_STAGING_REPO }}
ECR_OPERATOR_RELEASE_IMAGE: ${{ secrets.ECR_OPERATOR_RELEASE_IMAGE }}

on:
workflow_dispatch:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
MakeBinary:
name: 'MakeContainerImage'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

permissions:
id-token: write
contents: read
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ~1.19.6
cache: false

jobs:
BuildAndUpload:
uses: ./.github/workflows/build-and-upload-release.yml
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-west-2

- name: Login to ECR
if: steps.cached_binaries.outputs.cache-hit == false
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Set up Docker Buildx
if: steps.cached_binaries.outputs.cache-hit == false
uses: docker/setup-buildx-action@v1

- name: Set up QEMU
if: steps.cached_binaries.outputs.cache-hit == false
uses: docker/setup-qemu-action@v1

- name: Build Cloudwatch Agent Operator Image and push to ECR
uses: docker/build-push-action@v4
if: steps.cached_binaries.outputs.cache-hit == false
with:
file: ./Dockerfile
context: .
push: true
tags: ${{ env.ECR_OPERATOR_STAGING_REPO }}:staging
platforms: linux/amd64, linux/arm64

e2e-test:
name: "Application Signals E2E Test"
needs: MakeBinary
uses: ./.github/workflows/application-signals-e2e-test.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
release: false
tag: 'integration-test'
tag: staging

0 comments on commit 0b6cb83

Please sign in to comment.