Adding changes needed for the SetTokenTransferFee Update #10179
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Run CCIP OCR3 Integration Test" | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| e2e_should_run: ${{ steps.changes.outputs.e2e_should_run }} | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Detect changes | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: changes | |
| with: | |
| list-files: "shell" | |
| # Run on all, except the chains/evm folder unless it's in a released version. | |
| filters: | | |
| e2e_should_run: | |
| - '!(chains/evm/**)' | |
| - 'chains/evm/gobindings/generated/!(latest/**)/**' | |
| - '.github/workflows/ccip-integration-test.yml' | |
| integration-test-matrix: | |
| needs: [changes] | |
| if: ${{ needs.changes.outputs.e2e_should_run == 'true' }} | |
| env: | |
| # We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests | |
| # when they should not be using it, while still allowing us to DRY up the setup | |
| DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| type: | |
| - name: "Fees Test" | |
| file: ccip_fees_test.go | |
| run: "" | |
| timeout: 12m | |
| - name: "Token Transfer Test" | |
| file: ccip_token_transfer_test.go | |
| run: "TestTokenTransfer_EVM2EVM" | |
| timeout: 12m | |
| - name: "USDC Test" | |
| file: ccip_usdc_test.go | |
| run: "" | |
| timeout: 12m | |
| - name: "OOO Execution Test" | |
| file: ccip_ooo_execution_test.go | |
| run: "" | |
| timeout: 12m | |
| - name: "Messaging Test Test_CCIPMessaging_EVM2EVM" | |
| file: ccip_messaging_test.go | |
| run: "^Test_CCIPMessaging_EVM2EVM$" | |
| timeout: 20m | |
| # Tests broken as of 2026-02-20 | |
| # - name: "Messaging Test Test_CCIPMessaging_EVM2Solana" | |
| # file: ccip_messaging_test.go | |
| # run: "^Test_CCIPMessaging_EVM2Solana$" | |
| # timeout: 30m | |
| # - name: "Messaging Test Test_CCIPMessaging_Solana2EVM" | |
| # file: ccip_messaging_test.go | |
| # run: "^Test_CCIPMessaging_Solana2EVM$" | |
| # timeout: 30m | |
| - name: "Messaging Test Test_CCIPMessaging_EVM2SolanaMultiExecReports" | |
| file: ccip_messaging_test.go | |
| run: "^Test_CCIPMessaging_EVM2SolanaMultiExecReports$" | |
| timeout: 35m | |
| - name: "Batching Test Test_CCIPBatching_MaxBatchSizeEVM" | |
| file: ccip_batching_test.go | |
| run: "Test_CCIPBatching_MaxBatchSizeEVM" | |
| timeout: 12m | |
| - name: "Batching Test Test_CCIPBatching_MultiSource" | |
| file: ccip_batching_test.go | |
| run: "^Test_CCIPBatching_MultiSource$" | |
| timeout: 12m | |
| - name: "Batching Test Test_CCIPBatching_MultiSource_MultiRoot" | |
| file: ccip_batching_test.go | |
| run: "Test_CCIPBatching_MultiSource_MultiRoot" | |
| timeout: 12m | |
| - name: "Batching Test Test_CCIPBatching_SingleSource" | |
| file: ccip_batching_test.go | |
| run: "^Test_CCIPBatching_SingleSource$" | |
| timeout: 12m | |
| - name: "Batching Test Test_CCIPBatching_SingleSource_MultiRoot" | |
| file: ccip_batching_test.go | |
| run: "Test_CCIPBatching_SingleSource_MultiRoot" | |
| timeout: 12m | |
| - name: "Gas Price Updates Test" | |
| file: ccip_gas_price_updates_test.go | |
| run: "" | |
| timeout: 12m | |
| # TODO: this can only run in docker for now, switch to in-memory and uncomment | |
| # - name: "Token Price Updates Test" | |
| # file: ccip_token_price_updates_test.go | |
| # run: "" | |
| # timeout: 12m | |
| - name: "CCIPReader Test" | |
| file: ccip_reader_test.go | |
| run: "" | |
| timeout: 5m | |
| - name: "Test_CCIPTopologies_EVM2EVM_RoleDON_AllSupportSource_SomeSupportDest" | |
| file: ccip_topologies_test.go | |
| run: "^Test_CCIPTopologies_EVM2EVM_RoleDON_AllSupportSource_SomeSupportDest$" | |
| timeout: 20m | |
| name: Integration Tests (${{ matrix.type.name }}) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free Disk Space | |
| uses: smartcontractkit/.github/actions/free-disk-space@free-disk-space/v1 | |
| - name: Checkout the chainlink-ccip repo | |
| uses: actions/checkout@v4 | |
| - name: Determine Go version | |
| id: go_version | |
| run: echo "GO_VERSION=$(cat go.mod |grep "^go"|cut -d' ' -f 2)" >> $GITHUB_ENV | |
| - name: Setup Go ${{ env.GO_VERSION }} | |
| uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Display Go version | |
| run: go version | |
| - name: Fetch latest pull request data | |
| id: fetch_pr_data | |
| uses: actions/github-script@v6 | |
| # only run this step if the event is a pull request or merge_group | |
| if: github.event_name == 'pull_request' || github.event_name == 'merge_group' | |
| with: | |
| script: | | |
| let pull_number; | |
| console.log(`Current eventName: ${context.eventName}`); | |
| if (context.eventName === 'pull_request') { | |
| pull_number = context.issue.number; | |
| console.log(`Event is pull_request, PR number: ${pull_number}`); | |
| } else if (context.eventName === 'merge_group') { | |
| console.log('Event is merge_group. Attempting to get PR number.'); | |
| if (context.payload.pull_request && typeof context.payload.pull_request.number === 'number') { | |
| pull_number = context.payload.pull_request.number; | |
| console.log(`Found PR number via context.payload.pull_request.number: ${pull_number}`); | |
| } else { | |
| console.warn('context.payload.pull_request.number is not available or not a number.'); | |
| if (context.payload.merge_group && context.payload.merge_group.head_ref) { | |
| const headRef = context.payload.merge_group.head_ref; | |
| console.log(`Attempting to parse PR number from merge_group.head_ref: ${headRef}`); | |
| // Example head_ref: "gh-readonly-queue/main/pr-123-abcdef1234567890" or "pr-123-abcdef" part of a larger string | |
| const match = headRef.match(/pr-(\d+)-[a-fA-F0-9]+/); | |
| if (match && match[1]) { | |
| pull_number = parseInt(match[1], 10); | |
| console.log(`Successfully extracted PR number from head_ref: ${pull_number}`); | |
| } else { | |
| console.error(`Could not extract PR number from head_ref: ${headRef}. Regex match failed.`); | |
| } | |
| } else { | |
| console.error('context.payload.merge_group.head_ref is not available for parsing.'); | |
| } | |
| } | |
| if (typeof pull_number !== 'number') { | |
| console.error(`Failed to determine PR number for merge_group event. pull_number is: ${pull_number}`); | |
| // Optionally, you could throw an error here to make the failure explicit: | |
| // throw new Error('Failed to determine PR number for merge_group event.'); | |
| } | |
| } | |
| if (typeof pull_number === 'number') { | |
| console.log(`Fetching PR data for PR #${pull_number}`); | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: pull_number | |
| }); | |
| return pr.data.body; | |
| } else { | |
| console.log('No valid pull request number determined. Skipping PR data fetch, returning empty string.'); | |
| return ''; | |
| } | |
| - name: Get the chainlink commit sha from PR description, if applicable | |
| id: get_chainlink_sha | |
| run: | | |
| default="develop" | |
| if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "merge_group" ]; then | |
| comment=$(cat <<'GREAT_PR_DESCRIPTION_HERE' | |
| ${{ steps.fetch_pr_data.outputs.result }} | |
| GREAT_PR_DESCRIPTION_HERE | |
| ) | |
| echo "$comment" | |
| core_ref=$(echo "$comment" | grep -oE 'core ref:\s*[a-f0-9]{40}' | awk '{print $NF}' || true) | |
| if [ -n "$core_ref" ]; then | |
| echo "Overriding chainlink repository commit hash with: $core_ref" | |
| echo "::set-output name=ref::$core_ref" | |
| else | |
| echo "Using default chainlink repository branch: $default" | |
| echo "::set-output name=ref::$default" | |
| fi | |
| else | |
| echo "::set-output name=ref::$default" | |
| fi | |
| - name: Clone Chainlink repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: smartcontractkit/chainlink | |
| ref: ${{ steps.get_chainlink_sha.outputs.ref }} | |
| path: chainlink | |
| - name: Get the correct chainlink-ccip commit SHA via GitHub API | |
| id: get_sha | |
| run: | | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| COMMIT_SHA=${{ github.event.pull_request.head.sha }} | |
| elif [ "${{ github.event_name }}" == "merge_group" ]; then | |
| COMMIT_SHA=${{ github.event.merge_group.head_sha }} | |
| else | |
| COMMIT_SHA=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/${{ github.repository }}/commits/${{ github.ref }}" | jq -r .sha) | |
| fi | |
| echo "::set-output name=sha::$COMMIT_SHA" | |
| - name: Update chainlink-ccip dependency in chainlink | |
| run: | | |
| cd $GITHUB_WORKSPACE/chainlink | |
| go get github.com/smartcontractkit/chainlink-ccip@${{ steps.get_sha.outputs.sha }} | |
| make gomodtidy | |
| - name: Setup Postgres | |
| uses: ./.github/actions/setup-postgres | |
| - name: Download Go vendor packages | |
| run: | | |
| cd $GITHUB_WORKSPACE/chainlink | |
| go mod download | |
| cd $GITHUB_WORKSPACE/chainlink/integration-tests | |
| go mod download | |
| - name: Build binary | |
| run: | | |
| cd $GITHUB_WORKSPACE/chainlink | |
| go build -o ccip.test . | |
| # TEMP: workaround issues with db schema pinning (https://github.com/smartcontractkit/capabilities/pull/234) | |
| # - name: Setup DB | |
| # run: | | |
| # cd $GITHUB_WORKSPACE/chainlink | |
| # ./ccip.test local db preparetest | |
| # env: | |
| # CL_DATABASE_URL: ${{ env.DB_URL }} | |
| - name: Setup DB | |
| shell: bash | |
| run: | | |
| go get github.com/smartcontractkit/chainlink/v2/core/store/cmd/preparetest@5b5d3f204863e43445685cb2f569f37514bb84f5 | |
| go run github.com/smartcontractkit/chainlink/v2/core/store/cmd/preparetest | |
| env: | |
| CL_DATABASE_URL: ${{ env.DB_URL }} | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@latest | |
| - name: ${{ matrix.type.name }} | |
| id: run-tests | |
| continue-on-error: true | |
| run: | | |
| run="${{ matrix.type.run }}" | |
| run_cmd="gotestsum --junitfile=test-results.xml --format=github-actions -- ${{ matrix.type.file }} -timeout ${{ matrix.type.timeout }}" | |
| if [ -n "$run" ]; then | |
| run_cmd="$run_cmd -run $run" | |
| fi | |
| echo "$run_cmd" | |
| cd $GITHUB_WORKSPACE/chainlink/integration-tests/smoke/ccip && $run_cmd | |
| env: | |
| CL_DATABASE_URL: ${{ env.DB_URL }} | |
| - name: Analyze and upload test results | |
| uses: smartcontractkit/.github/actions/branch-out-upload@branch-out-upload/v1 | |
| with: | |
| junit-file-path: ${{ github.workspace }}/chainlink/integration-tests/smoke/ccip/test-results.xml | |
| trunk-org-slug: chainlink | |
| trunk-previous-step-outcome: ${{ steps.run-tests.outcome }} | |
| trunk-token: ${{ secrets.TRUNK_API_KEY }} | |
| trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }} | |
| integration-test-ccip-ocr3: | |
| if: always() | |
| runs-on: ubuntu-latest | |
| needs: [integration-test-matrix] | |
| steps: | |
| - name: Fail the job if ccip tests in PR not successful | |
| if: always() && needs.integration-test-matrix.result == 'failure' | |
| run: exit 1 |