Skip to content

Commit

Permalink
Add check for existence of ECR images used as test dependencies in E2…
Browse files Browse the repository at this point in the history
…E EVM compatibility tests (#13271)

* Add check for existence of ECR images used as test dependencies

The code changes include adding a new step in the workflow file `evm-version-compatibility-tests.yml` to check if the images used as test dependencies exist in the ECR. This step is triggered when there is a change in the test dependency or when the workflow is manually dispatched. The step checks if the latest Ethereum client image exists in the ECR and fails the workflow if it doesn't exist.

* Add CTF workflow trigger job

* Add permissions for the trigger job

* Add actions: read permission

* Refactor workflow

* Fix

* fix

* Use update-internal-mirrors action from CTF to wait until image is updated

* Bump action version

* Add image check to evm compatibility tests

* Bump action version

* Check images for other clients

* Check only ethereum/client-go in evm-version-compatibility-tests.yml
  • Loading branch information
lukaszcl authored May 28, 2024
1 parent ae56e5a commit 2f6778d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,39 @@ env:
jobs:
# Build Test Dependencies

check-ecr-images-exist:
environment: integration
permissions:
id-token: write
contents: read
name: Check images used as test dependencies exist in ECR
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mirror:
- name: ethereum/client-go
expression: '^(alltools-v|v)[0-9]\.[0-9]+\.[0-9]+$'
- name: hyperledger/besu
expression: '^[0-9]+\.[0-9]+(\.[0-9]+)?$'
page_size: 300
- name: thorax/erigon
expression: '^v[0-9]+\.[0-9]+\.[0-9]+$'
- name: nethermind/nethermind
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
- name: tofelb/ethereum-genesis-generator
expression: '^[0-9]+\.[0-9]+\.[0-9]+(\-slots\-per\-epoch)?'
steps:
- name: Update internal ECR if the latest Ethereum client image does not exist
uses: smartcontractkit/chainlink-testing-framework/.github/actions/update-internal-mirrors@7eb04a030823b316d8dd5bb555f1e49593a503fc
with:
aws_region: ${{ secrets.QA_AWS_REGION }}
role_to_assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
aws_account_number: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
image_name: ${{matrix.mirror.name}}
expression: ${{matrix.mirror.expression}}
page_size: ${{matrix.mirror.page_size}}

build-chainlink:
environment: integration
permissions:
Expand Down Expand Up @@ -55,7 +88,7 @@ jobs:
pull-requests: write
id-token: write
contents: read
needs: [build-chainlink]
needs: [build-chainlink, check-ecr-images-exist]
env:
SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
Expand Down Expand Up @@ -335,4 +368,4 @@ jobs:
message_title: ${{ matrix.product }}
slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }}
slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }}
slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }}
slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }}
27 changes: 23 additions & 4 deletions .github/workflows/evm-version-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ env:
MOD_CACHE_VERSION: 2

jobs:

# Check if go.mod has changed
check-dependency-bump:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,11 +54,31 @@ jobs:
echo "dependency_changed=false" >> $GITHUB_OUTPUT
fi
# Check if images used as test dependencies exist in the ECR
check-ecr-images-exist:
if: needs.check-dependency-bump.outputs.dependency_changed == 'true' || github.event_name == 'workflow_dispatch'
needs: [check-dependency-bump]
environment: integration
permissions:
id-token: write
contents: read
name: Check images used as test dependencies exist in ECR
runs-on: ubuntu-latest
steps:
- name: Update internal ECR if the latest Ethereum client image does not exist
uses: smartcontractkit/chainlink-testing-framework/.github/actions/update-internal-mirrors@7eb04a030823b316d8dd5bb555f1e49593a503fc
with:
aws_region: ${{ secrets.QA_AWS_REGION }}
role_to_assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
aws_account_number: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
image_name: 'ethereum/client-go'
expression: '^(alltools-v|v)[0-9]\.[0-9]+\.[0-9]+$'

# Build Test Dependencies

build-chainlink:
if: needs.check-dependency-bump.outputs.dependency_changed == 'true' || github.event_name == 'workflow_dispatch'
needs: [check-dependency-bump]
needs: [check-dependency-bump, check-ecr-images-exist]
environment: integration
permissions:
id-token: write
Expand Down Expand Up @@ -92,7 +111,7 @@ jobs:

build-tests:
if: needs.check-dependency-bump.outputs.dependency_changed == 'true' || github.event_name == 'workflow_dispatch'
needs: [check-dependency-bump]
needs: [check-dependency-bump, check-ecr-images-exist]
environment: integration
permissions:
id-token: write
Expand Down Expand Up @@ -127,7 +146,7 @@ jobs:

build-test-matrix:
if: needs.check-dependency-bump.outputs.dependency_changed == 'true' || github.event_name == 'workflow_dispatch'
needs: [check-dependency-bump]
needs: [check-dependency-bump, check-ecr-images-exist]
runs-on: ubuntu-latest
name: Build Test Matrix
outputs:
Expand Down

0 comments on commit 2f6778d

Please sign in to comment.