Skip to content

Commit

Permalink
[TT-1252] Correct the evm/relayer replace and enable more reuse in th…
Browse files Browse the repository at this point in the history
…e ci-core setup actions (#13592)

* [TT-1252] Evm dispatch

* Bump actions to get evm relayer deps change

* change back to a replace until the migration is complete

* one more replace

* Move the dependency change higher up

* bump chainlink-github-actions versions

* merge conflict fixes

* set specific setup-github-token version

* Add an input base path to the setup actions

* merge conflict fix and bump to newer version

* revert mod version bump since it has a regression
  • Loading branch information
tateexon authored Jul 9, 2024
1 parent c5f9173 commit bc1ca7d
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-chainlink-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ runs:
- name: Check if image exists
if: ${{ inputs.dep_evm_sha != '' || inputs.check_image_exists == 'true'}}
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: chainlink
tag: ${{ inputs.git_commit_sha }}${{ inputs.tag_suffix }}
AWS_REGION: ${{ inputs.AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists != 'true'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ inputs.git_commit_sha }}
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ runs:
- name: Check if test base image exists
if: steps.version.outputs.is_semantic == 'false'
id: check-base-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: test-base-image
tag: ${{ steps.long_sha.outputs.long_sha }}
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Base Image
if: steps.version.outputs.is_semantic == 'false' && steps.check-base-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/docker/build-push@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/build-push@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
env:
BASE_IMAGE_NAME: ${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image:${{ steps.long_sha.outputs.long_sha }}
with:
Expand All @@ -92,15 +92,15 @@ runs:
# Test Runner Logic
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: ${{ inputs.repository }}
tag: ${{ inputs.tag }}
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
- name: Build and Publish Test Runner
if: steps.check-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/docker/build-push@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/build-push@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
tags: |
${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/${{ inputs.repository }}:${{ inputs.tag }}
Expand Down
10 changes: 7 additions & 3 deletions .github/actions/setup-nodejs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ inputs:
prod:
default: "false"
description: Set to 'true' to do a prod only install
base-path:
description: Path to the base of the repo
required: false
default: .
description: Setup pnpm for contracts
runs:
using: composite
Expand All @@ -15,16 +19,16 @@ runs:
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: "contracts/pnpm-lock.yaml"
cache-dependency-path: "${{ inputs.base-path }}/contracts/pnpm-lock.yaml"

- if: ${{ inputs.prod == 'false' }}
name: Install dependencies
shell: bash
run: pnpm i
working-directory: contracts
working-directory: ${{ inputs.base-path }}/contracts

- if: ${{ inputs.prod == 'true' }}
name: Install prod dependencies
shell: bash
run: pnpm i --prod
working-directory: contracts
working-directory: ${{ inputs.base-path }}/contracts
9 changes: 7 additions & 2 deletions .github/actions/setup-postgres/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Setup Postgresql
description: Setup postgres docker container via docker-compose, allowing usage of a custom command, see https://github.com/orgs/community/discussions/26688
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
- name: Start postgres service
run: docker compose up -d
shell: bash
working-directory: ./.github/actions/setup-postgres
working-directory: ${{ inputs.base-path }}/.github/actions/setup-postgres
- name: Wait for postgres service to be healthy
run: ./wait-for-healthy-postgres.sh
shell: bash
working-directory: ./.github/actions/setup-postgres
working-directory: ${{ inputs.base-path }}/.github/actions/setup-postgres
8 changes: 7 additions & 1 deletion .github/actions/setup-solana/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Setup Solana CLI
description: Setup solana CLI
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
Expand All @@ -9,11 +14,12 @@ runs:
with:
path: |
~/.local/share/solana/install/active_release/bin
key: ${{ runner.os }}-solana-cli-${{ hashFiles('./tools/ci/install_solana') }}
key: ${{ runner.os }}-solana-cli-${{ hashFiles('${{ inputs.base-path }}tools/ci/install_solana') }}

- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install solana cli
shell: bash
working-directory: ${{ inputs.base-path }}
run: ./tools/ci/install_solana

- name: Export solana path to env
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/setup-wasmd/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Setup Cosmos wasmd
description: Setup Cosmos wasmd, used for integration tests
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
Expand All @@ -10,11 +15,12 @@ runs:
path: ~/wasmd-build
# this caching works without cloning the repo because the install_wasmd contains
# the commit hash.
key: ${{ runner.os }}-wasmd-cli-${{ hashFiles('./tools/ci/install_wasmd') }}
key: ${{ runner.os }}-wasmd-cli-${{ hashFiles('${{ inputs.base-path }}/tools/ci/install_wasmd') }}

- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install wasmd
shell: bash
working-directory: ${{ inputs.base-path }}
run: ./tools/ci/install_wasmd

- name: Export wasmd path to env
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/version-file-bump/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
current_version=$(jq -r '.version' ./package.json)
echo "current_version=${current_version}" | tee -a "$GITHUB_OUTPUT"
- name: Compare semantic versions
uses: smartcontractkit/chainlink-github-actions/semver-compare@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/semver-compare@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
id: compare
with:
version1: ${{ steps.get-current-version.outputs.current_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automation-benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
suites: benchmark chaos reorg load
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@af92c5fae8dcf1659201e907db82d221fc304b94 # v2.3.21
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
env:
DETACH_RUNNER: true
TEST_SUITE: benchmark
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automation-load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
suites: benchmark chaos reorg load
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@af92c5fae8dcf1659201e907db82d221fc304b94 # v2.3.21
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
env:
RR_CPU: 4000m
RR_MEM: 4Gi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automation-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@af92c5fae8dcf1659201e907db82d221fc304b94 # v2.3.21
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
env:
TEST_SUITE: ${{ matrix.tests.suite }}
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/automation-ondemand-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ jobs:
- name: Check if image exists
if: inputs.chainlinkImage == ''
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: chainlink
tag: ${{ github.sha }}${{ matrix.image.tag-suffix }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false' && inputs.chainlinkImage == ''
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.sha }}
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.24
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
if: ${{ matrix.tests.enabled == true }}
env:
TEST_SUITE: ${{ matrix.tests.suite }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: ${{ env.ECR_IMAGE_NAME}}
tag: sha-${{ env.GIT_SHORT_SHA }}
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ jobs:
if: github.actor != 'dependabot[bot]'
needs: [filter]
runs-on: ${{ matrix.type.os }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -115,6 +118,10 @@ jobs:
- name: Setup Go
if: ${{ needs.filter.outputs.changes == 'true' }}
uses: ./.github/actions/setup-go
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }}
- name: Setup Solana
if: ${{ needs.filter.outputs.changes == 'true' }}
uses: ./.github/actions/setup-solana
Expand All @@ -130,10 +137,6 @@ jobs:
- name: Download Go vendor packages
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go mod download
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-evm@${{ inputs.evm-ref }}
- name: Build binary
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go build -o chainlink.test .
Expand Down Expand Up @@ -174,7 +177,7 @@ jobs:
CL_DATABASE_URL: ${{ env.DB_URL }}
run: ./tools/bin/${{ matrix.type.cmd }} ./...
- name: Print Filtered Test Results
if: ${{ failure() && matrix.type.cmd == 'go_core_tests' && needs.filter.outputs.changes == 'true' }}
if: ${{ failure() && matrix.type.cmd == 'go_core_tests' && needs.filter.outputs.changes == 'true' && steps.run-tests.conclusion == 'failure' }}
run: |
cat output.txt | gotestloghelper -ci
- name: Print Races
Expand Down Expand Up @@ -244,6 +247,9 @@ jobs:
if: ${{ always() && github.actor != 'dependabot[bot]' }}
env:
CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
permissions:
id-token: write
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -270,7 +276,7 @@ jobs:
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-evm@${{ inputs.evm-ref }}
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }}
- name: Build binary
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go build -o chainlink.test .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ jobs:
}
echo "TEST_LOG_NAME=$(replace_special_chars "${{ matrix.evm_node.product }}-${{ matrix.evm_node.docker_image }}-test-logs")" >> $GITHUB_ENV
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.24
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
test_command_to_run: cd ./integration-tests && touch .root_dir && go test -timeout 30m -count=1 -json ${{ matrix.evm_node.run }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs
test_download_vendor_packages_command: cd ./integration-tests && go mod download
Expand Down Expand Up @@ -607,7 +607,7 @@ jobs:

- name: Print failed test summary
if: always()
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25

start-slack-thread:
name: Start Slack Thread
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-chaos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
repository: chainlink
tag: ${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.sha }}
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@af92c5fae8dcf1659201e907db82d221fc304b94 # v2.3.21
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@75a9005952a9e905649cfb5a6971fd9429436acd # v2.3.25
with:
test_command_to_run: cd integration-tests && go test -timeout 1h -count=1 -json -test.parallel 11 ./chaos 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs
test_download_vendor_packages_command: cd ./integration-tests && go mod download
Expand Down
Loading

0 comments on commit bc1ca7d

Please sign in to comment.