From 0d522eb9ac3ef2610a7442e258ae7706485d7349 Mon Sep 17 00:00:00 2001 From: Tate Date: Tue, 14 Nov 2023 12:24:52 -0700 Subject: [PATCH] [TT-707] chainlink-tests image build workflow dispatch --- .github/actions/build-test-image/action.yml | 6 +++++- .../workflows/integration-tests-publish.yml | 20 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml index a241f51d920..252b292d031 100644 --- a/.github/actions/build-test-image/action.yml +++ b/.github/actions/build-test-image/action.yml @@ -17,6 +17,9 @@ inputs: description: The test suites to build into the image default: chaos migration performance reorg smoke soak benchmark required: false + base_image_tag: + description: The test base image version to use, if not provided it will use the version from the ./integration-tests/go.mod file + required: false QA_AWS_ROLE_TO_ASSUME: description: The AWS role to assume as the CD user, if any. Used in configuring the docker/login-action required: true @@ -31,6 +34,7 @@ runs: using: composite steps: - name: Get CTF Version + if: ${{ inputs.base_image_tag == '' }} id: version uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/mod-version@e865e376b8c2d594028c8d645dd6c47169b72974 # v2.2.16 with: @@ -55,7 +59,7 @@ runs: file: ./integration-tests/test.Dockerfile build-args: | BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=${{ steps.version.outputs.version }} + IMAGE_VERSION=${{ inputs.base_image_tag || steps.version.outputs.version }} SUITES="${{ inputs.suites }}" AWS_REGION: ${{ inputs.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} diff --git a/.github/workflows/integration-tests-publish.yml b/.github/workflows/integration-tests-publish.yml index a66ea612281..9579b83b98e 100644 --- a/.github/workflows/integration-tests-publish.yml +++ b/.github/workflows/integration-tests-publish.yml @@ -5,9 +5,20 @@ on: push: branches: - develop + workflow_dispatch: + inputs: + chainlink-tests-tag: + description: 'The tag to be pushed' + required: true + ctf-base-image-tag: + description: | + 'The tag of the CTF base image to be used, + typically something like v1.18.6 from https://github.com/smartcontractkit/chainlink-testing-framework/releases + or a custom tag or branch you have pushed.' + required: true env: - ECR_TAG: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:develop + ECR_TAG_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests jobs: publish-integration-test-image: @@ -16,7 +27,7 @@ jobs: id-token: write contents: read name: Publish Integration Test Image - runs-on: ubuntu-latest + runs-on: ubuntu20.04-16cores-64GB steps: - name: Collect Metrics id: collect-gha-metrics @@ -29,11 +40,12 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Build Image uses: ./.github/actions/build-test-image with: - other_tags: ${{ env.ECR_TAG }} + other_tags: "${{ env.ECR_TAG_BASE }}:${{ inputs.chainlink-tests-tag || 'develop' }}" + base_image_tag: ${{ inputs.ctf-base-image-tag }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}