From 4c4729a0684aa33c692caf6b3aef31dccf641d7d Mon Sep 17 00:00:00 2001 From: Tate Date: Tue, 18 Jun 2024 14:13:37 -0600 Subject: [PATCH] Move the dependency change higher up --- .../actions/build-chainlink-image/action.yml | 4 +- .github/workflows/ci-core.yml | 74 +++++++++++++------ .github/workflows/integration-tests.yml | 9 +++ 3 files changed, 62 insertions(+), 25 deletions(-) diff --git a/.github/actions/build-chainlink-image/action.yml b/.github/actions/build-chainlink-image/action.yml index c0fbb0fe379..f584d90c1ec 100644 --- a/.github/actions/build-chainlink-image/action.yml +++ b/.github/actions/build-chainlink-image/action.yml @@ -25,7 +25,7 @@ runs: - name: Check if image exists if: ${{ inputs.dep_evm_sha != '' }} id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@3380b79a5af6524101cf1bd33188f73a800f7490 # v2.3.22 + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@027436f63ad08b6e8eb92a85104ade234fb4ea43 # v2.3.24 with: repository: chainlink tag: ${{ inputs.git_commit_sha }}${{ inputs.tag_suffix }} @@ -33,7 +33,7 @@ runs: 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@3380b79a5af6524101cf1bd33188f73a800f7490 # v2.3.22 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@027436f63ad08b6e8eb92a85104ade234fb4ea43 # v2.3.24 with: cl_repo: smartcontractkit/chainlink cl_ref: ${{ inputs.git_commit_sha }} diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 0c45e5bdbda..b970cb9d1d6 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -97,6 +97,9 @@ jobs: if: github.actor != 'dependabot[bot]' needs: [filter] runs-on: ubuntu-latest-64cores-256GB + permissions: + id-token: write + contents: read steps: - name: Checkout the repo uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -111,6 +114,30 @@ jobs: - name: Setup Go if: ${{ needs.filter.outputs.changes == 'true' }} uses: ./.github/actions/setup-go + + - name: Setup Github Token + id: get-gh-token + uses: smartcontractkit/.github/actions/setup-github-token@main + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + set-git-config: "true" + - name: Replace the chainlink-integration deps + if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}} + shell: bash + env: + MODULE: github.com/smartcontractkit/chainlink-integrations/evm/relayer + COMMIT_HASH: ${{ inputs.evm-ref }} + run: | + # Update to the evm/relayer code we wish to test against + go env -w GOPRIVATE=github.com/smartcontractkit/chainlink-integrations + go get ${MODULE}@${COMMIT_HASH} + # push replace into core go.mod, remove this once the evm migration is complete + PSEUDO_VERSION=$(go list -m -mod=mod ${MODULE}@${COMMIT_HASH} | awk '{print $2}') + go mod edit -replace=github.com/smartcontractkit/chainlink/v2/core/chains/evm=${MODULE}@${PSEUDO_VERSION} + go mod tidy + - name: Run short tests if: ${{ needs.filter.outputs.changes == 'true' && matrix.type.cmd == 'go_core_tests' }} run: go test -short ./... @@ -129,19 +156,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: | - # Put this back in and remove the replace once the migration is complete - #go get github.com/smartcontractkit/chainlink-integrations/evm/relayerm@${{ inputs.evm-ref }} - # push replace into core go.mod - cat <> go.mod - replace ( - github.com/smartcontractkit/chainlink/v2/core/chains/evm => ./chainlink-integrations/evm/relayer@${{ inputs.evm-ref }} - ) - EOT - go mod tidy - name: Build binary if: ${{ needs.filter.outputs.changes == 'true' }} run: go build -o chainlink.test . @@ -182,7 +196,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 @@ -252,6 +266,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 @@ -275,19 +292,30 @@ jobs: - name: Download Go vendor packages if: ${{ needs.filter.outputs.changes == 'true' }} run: go mod download - - name: Replace chainlink-integration deps + + - name: Setup Github Token + id: get-gh-token + uses: smartcontractkit/.github/actions/setup-github-token@main + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + set-git-config: "true" + - name: Replace the chainlink-integration deps if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}} shell: bash + env: + MODULE: github.com/smartcontractkit/chainlink-integrations/evm/relayer + COMMIT_HASH: ${{ inputs.evm-ref }} run: | - # Put this back in and remove the replace once the migration is complete - #go get github.com/smartcontractkit/chainlink-integrations/evm/relayerm@${{ inputs.evm-ref }} - # push replace into core go.mod - cat <> go.mod - replace ( - github.com/smartcontractkit/chainlink/v2/core/chains/evm => ./chainlink-integrations/evm/relayer@${{ inputs.evm-ref }} - ) - EOT + # Update to the evm/relayer code we wish to test against + go env -w GOPRIVATE=github.com/smartcontractkit/chainlink-integrations + go get ${MODULE}@${COMMIT_HASH} + # push replace into core go.mod, remove this once the evm migration is complete + PSEUDO_VERSION=$(go list -m -mod=mod ${MODULE}@${COMMIT_HASH} | awk '{print $2}') + go mod edit -replace=github.com/smartcontractkit/chainlink/v2/core/chains/evm=${MODULE}@${PSEUDO_VERSION} go mod tidy + - name: Build binary if: ${{ needs.filter.outputs.changes == 'true' }} run: go build -o chainlink.test . diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 25756603456..9a008d8ff41 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -209,6 +209,15 @@ jobs: with: repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Setup Github Token + if: ${{ inputs.evm-ref }} + id: get-gh-token + uses: smartcontractkit/.github/actions/setup-github-token@main + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + set-git-config: "true" - name: Build Chainlink Image if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/actions/build-chainlink-image