Integration Tests #70613
This file contains 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: Integration Tests | |
run-name: Integration Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} | |
on: | |
merge_group: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
cl_ref: | |
description: 'The ref to checkout, defaults to the calling branch' | |
required: false | |
type: string | |
evm-ref: | |
description: 'The sha of the chainlink-evm commit to use if wanted' | |
required: false | |
type: string | |
distinct_run_name: | |
description: 'A unique identifier for this run, only use from other repos' | |
required: false | |
type: string | |
# Only run 1 of this workflow at a time per PR | |
concurrency: | |
group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests-${{ inputs.distinct_run_name }} | |
cancel-in-progress: true | |
env: | |
# for run-test variables and environment | |
TEST_SUITE: smoke | |
TEST_ARGS: -test.timeout 12m | |
COLLECTION_ID: chainlink-integration-tests | |
jobs: | |
changes: | |
environment: integration | |
name: Check Paths That Require Tests To Run | |
runs-on: ubuntu-latest | |
# We don't directly merge dependabot PRs, so let's not waste the resources | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout the repo | |
uses: actions/[email protected] | |
with: | |
repository: smartcontractkit/chainlink | |
ref: ${{ inputs.cl_ref }} | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: changes | |
with: | |
filters: | | |
github_ci_changes: | |
- '.github/workflows/integration-tests.yml' | |
- '.github/integration-tests.yml' | |
core_changes: | |
- '**/*.go' | |
- '**/*go.sum' | |
- '**/*go.mod' | |
- '**/*Dockerfile' | |
- 'core/**/migrations/*.sql' | |
- 'core/**/config/**/*.toml' | |
- 'integration-tests/**/*.toml' | |
ccip_changes: | |
- '**/*ccip*' | |
- '**/*ccip*/**' | |
- name: Ignore Filter On Workflow Dispatch | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
id: ignore-filter | |
run: echo "changes=true" >> $GITHUB_OUTPUT | |
outputs: | |
github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} | |
core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} | |
ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} | |
lint-integration-tests: | |
name: Lint ${{ matrix.project.name }} | |
runs-on: ubuntu-24.04-8cores-32GB-ARM | |
# We don't directly merge dependabot PRs, so let's not waste the resources | |
if: github.actor != 'dependabot[bot]' | |
strategy: | |
matrix: | |
project: | |
- name: integration-tests | |
id: integration-tests | |
path: ./integration-tests | |
cache_id: integration-tests | |
steps: | |
- name: Checkout the repo | |
uses: actions/[email protected] | |
with: | |
repository: smartcontractkit/chainlink | |
ref: ${{ inputs.cl_ref }} | |
- name: Setup Go | |
uses: smartcontractkit/.github/actions/ctf-setup-go@b0d756c57fcdbcff187e74166562a029fdd5d1b9 # [email protected] | |
with: | |
test_download_vendor_packages_command: cd ${{ matrix.project.path }} && go mod download | |
go_mod_path: ${{ matrix.project.path }}/go.mod | |
cache_key_id: ${{ matrix.project.cache_id }} | |
cache_restore_only: "true" | |
- name: Lint Go | |
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 | |
with: | |
version: v1.62.0 | |
# We already cache these directories in setup-go | |
skip-pkg-cache: true | |
skip-build-cache: true | |
# only-new-issues is only applicable to PRs, otherwise it is always set to false | |
only-new-issues: false # disabled for PRs due to unreliability | |
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml | |
working-directory: ${{ matrix.project.path }} | |
run-ccip-integration-tests-for-pr: | |
name: Run CCIP integration Tests For PR | |
permissions: | |
actions: read | |
checks: write | |
pull-requests: write | |
id-token: write | |
contents: read | |
needs: changes | |
if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') | |
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@4040efd7a017bbeb7b6a8e78fb314372d4566ce4 #[email protected] | |
with: | |
workflow_name: Run CCIP Integration Tests For PR | |
test_path: .github/integration-tests.yml | |
test_trigger: PR Integration CCIP Tests | |
secrets: | |
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} | |
PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} | |
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} | |
run-ccip-integration-tests-for-merge-queue: | |
name: Run CCIP Integration Tests For Merge Queue | |
permissions: | |
actions: read | |
checks: write | |
pull-requests: write | |
id-token: write | |
contents: read | |
needs: changes | |
if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') | |
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@4040efd7a017bbeb7b6a8e78fb314372d4566ce4 #[email protected] | |
with: | |
workflow_name: Run CCIP Integration Tests For Merge Queue | |
test_path: .github/integration-tests.yml | |
test_trigger: Merge Queue integration CCIP Tests | |
slack_notification_after_tests: on_failure | |
slack_notification_after_tests_channel_id: "#ccip-testing" | |
slack_notification_after_tests_name: CCIP integration Tests In Merge Queue | |
secrets: | |
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} | |
PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} | |
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} | |
check-integration-test-results: | |
if: always() | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
needs: [lint-integration-tests,run-ccip-integration-tests-for-pr,run-ccip-integration-tests-for-merge-queue] | |
steps: | |
- name: Fail the job if core tests in PR not successful | |
if: always() && needs.run-core-integration-tests-for-pr.result == 'failure' | |
run: exit 1 | |
- name: Fail the job if core tests in merge queue not successful | |
if: always() && needs.run-core-integration-tests-for-merge-queue.result == 'failure' | |
run: exit 1 | |
- name: Fail the job if lint not successful | |
if: always() && needs.lint-integration-tests.result == 'failure' | |
run: exit 1 | |
cleanup: | |
name: Clean up integration environment deployments | |
if: always() | |
needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/[email protected] | |
with: | |
repository: smartcontractkit/chainlink | |
ref: ${{ inputs.cl_ref }} | |
- name: 🧼 Clean up Environment | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: ./.github/actions/delete-deployments | |
with: | |
environment: integration | |
ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 | |