From 4d3a9629b2e223c6525a6e286e8d1a9f3d767d5c Mon Sep 17 00:00:00 2001 From: Tate <tate.exon@smartcontract.com> Date: Wed, 6 Mar 2024 13:26:43 -0700 Subject: [PATCH 1/4] [TT-974] Setup workflows to be called from chainlink-evm --- .../actions/build-chainlink-image/action.yml | 8 +- .github/workflows/integration-tests.yml | 97 +++++++++++++++---- 2 files changed, 85 insertions(+), 20 deletions(-) diff --git a/.github/actions/build-chainlink-image/action.yml b/.github/actions/build-chainlink-image/action.yml index 324a5353b24..75a5147248a 100644 --- a/.github/actions/build-chainlink-image/action.yml +++ b/.github/actions/build-chainlink-image/action.yml @@ -15,13 +15,16 @@ inputs: description: "AWS region to use for ECR" AWS_ROLE_TO_ASSUME: description: "AWS role to assume for ECR" + dep_evm_sha: + description: The chainlink-evm commit sha to use in go deps + required: false runs: using: composite steps: - name: Check if image exists id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@5bee84d30d90295010bda68b0cd46be3a1eea917 # v2.3.8 with: repository: chainlink tag: ${{ inputs.git_commit_sha }}${{ inputs.tag_suffix }} @@ -29,7 +32,7 @@ runs: AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }} - name: Build Image if: steps.check-image.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@5bee84d30d90295010bda68b0cd46be3a1eea917 # v2.3.8 with: cl_repo: smartcontractkit/chainlink cl_ref: ${{ inputs.git_commit_sha }} @@ -37,6 +40,7 @@ runs: push_tag: ${{ env.CHAINLINK_IMAGE }}:${{ inputs.git_commit_sha }}${{ inputs.tag_suffix }} QA_AWS_REGION: ${{ inputs.AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }} + dep_evm_sha: ${{ inputs.dep_evm_sha }} - name: Print Chainlink Image Built shell: sh run: | diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e8c15109938..95b58c43200 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -6,6 +6,41 @@ on: tags: - "*" workflow_dispatch: + inputs: + cl_ref: + description: 'The ref to checkout, defaults to the calling branch' + required: false + type: string + dep_evm_sha: + description: 'The sha of the chainlink-evm commit to use if wanted' + required: false + type: string + set_changes_output: + description: 'Set the changes output' + required: false + type: string + default: 'true' + workflow_call: + inputs: + cl_ref: + description: 'The ref to checkout' + required: false + type: string + default: 'develop' + dep_evm_sha: + description: 'The sha of the chainlink-evm commit to use if wanted' + required: false + type: string + set_changes_output: + description: 'Set the changes output' + required: false + type: string + default: 'true' + run_solana: + description: 'Run solana tests' + required: false + type: string + default: 'false' # Only run 1 of this workflow at a time per PR concurrency: @@ -26,8 +61,12 @@ jobs: name: Enforce CTF Version runs-on: ubuntu-latest steps: + - run: echo "${{github.event_name}}" - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} - name: Check Merge Group Condition id: condition-check run: | @@ -57,6 +96,9 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} - uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 id: changes with: @@ -80,7 +122,7 @@ jobs: this-job-name: Check Paths That Require Tests To Run continue-on-error: true outputs: - src: ${{ steps.changes.outputs.src }} + src: ${{ inputs.set_changes_output || steps.changes.outputs.src }} build-lint-integration-tests: name: Build and Lint integration-tests @@ -97,6 +139,9 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} - name: Setup Go uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 with: @@ -152,7 +197,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Chainlink Image if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/actions/build-chainlink-image @@ -162,6 +208,7 @@ jobs: git_commit_sha: ${{ github.sha }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + dep_evm_sha: ${{ inputs.dep_evm_sha }} build-test-image: if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'schedule' || contains(join(github.event.pull_request.labels.*.name, ' '), 'build-test-image') @@ -186,7 +233,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Test Image if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/actions/build-test-image @@ -210,6 +258,9 @@ jobs: exit 0 - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} - name: Compare Test Lists run: | cd ./integration-tests @@ -279,7 +330,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Go Test Command id: build-go-test-command run: | @@ -300,9 +352,9 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" @@ -367,7 +419,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Go Test Command id: build-go-test-command run: | @@ -388,9 +441,9 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" @@ -497,7 +550,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Go Test Command id: build-go-test-command run: | @@ -570,9 +624,9 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: ${{ secrets.LOKI_URL }} - lokiTenantId: ${{ vars.LOKI_TENANT_ID }} - lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" @@ -664,6 +718,9 @@ jobs: - name: Checkout repo if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} - name: 🧼 Clean up Environment if: ${{ github.event_name == 'pull_request' }} @@ -695,7 +752,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Run Setup uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 with: @@ -734,7 +792,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Get Latest Version id: get_latest_version run: | @@ -790,6 +849,7 @@ jobs: ## Solana Section get_solana_sha: + if: ${{ inputs.run_solana != 'false' }} name: Get Solana Sha From Go Mod environment: Integration runs-on: ubuntu-latest @@ -799,7 +859,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Setup Go uses: ./.github/actions/setup-go with: From a7b496a1a85ac251dbf77d8b82dd6d5323cbd43b Mon Sep 17 00:00:00 2001 From: Tate <tate.exon@smartcontract.com> Date: Thu, 7 Mar 2024 09:01:54 -0700 Subject: [PATCH 2/4] fix loki url --- .github/workflows/integration-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f57aedc5c97..3e2ee85b1e1 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -358,7 +358,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} @@ -447,7 +447,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} @@ -630,7 +630,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} From 0531a5a904a04238b63f4c321eb97332e82d62dc Mon Sep 17 00:00:00 2001 From: Tate <tate.exon@smartcontract.com> Date: Thu, 7 Mar 2024 09:06:48 -0700 Subject: [PATCH 3/4] fix merge conflicts --- .github/workflows/integration-tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3e2ee85b1e1..3f67b08c83a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -855,12 +855,11 @@ jobs: ## Solana Section get_solana_sha: - if: ${{ inputs.run_solana != 'false' }} + # We don't directly merge dependabot PRs, so let's not waste the resources + if: ${{ github.actor != 'dependabot[bot]' && inputs.run_solana != 'false' }} name: Get Solana Sha From Go Mod environment: Integration runs-on: ubuntu-latest - # We don't directly merge dependabot PRs, so let's not waste the resources - if: github.actor != 'dependabot[bot]' outputs: sha: ${{ steps.getsha.outputs.sha }} steps: From f28aa261675c3c94cb98e3e0bb137eefa8b17e87 Mon Sep 17 00:00:00 2001 From: Tate <tate.exon@smartcontract.com> Date: Thu, 7 Mar 2024 09:48:04 -0700 Subject: [PATCH 4/4] loki url change again --- .github/workflows/integration-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3f67b08c83a..b08002667c9 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -358,7 +358,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} @@ -447,7 +447,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} @@ -630,7 +630,7 @@ jobs: pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} - lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }} + lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push lokiTenantId: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} lokiBasicAuth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }}