diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c15dfc7eec..8b56b88b70 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -491,310 +491,3 @@ jobs: merge-multiple: true - name: Show Coverage run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" - - ## Solana Section - get_solana_sha: - # 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 - outputs: - sha: ${{ steps.getsha.outputs.sha }} - steps: - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/ccip - 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: - only-modules: "true" - - name: Get the sha from go mod - id: getshortsha - run: | - sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version) - if [ -z "${sol_ver}" ]; then - echo "Error: could not get the solana version from the go.mod file, look above for error(s)" - exit 1 - fi - short_sha="${sol_ver##*-}" - echo "short sha is: ${short_sha}" - echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" - - name: Checkout solana - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink-solana - ref: develop - fetch-depth: 0 - path: solanapath - - name: Get long sha - id: getsha - run: | - cd solanapath - full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well - if [ -z "${full_sha}" ]; then - echo "Error: could not get the full sha from the short sha using git, look above for error(s)" - exit 1 - fi - echo "sha is: ${full_sha}" - echo "sha=${full_sha}" >> "$GITHUB_OUTPUT" - - get_projectserum_version: - name: Get ProjectSerum Version - environment: integration - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} - steps: - - name: Checkout the solana repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Get ProjectSerum Version - id: psversion - uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 - - solana-test-image-exists: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Check If Solana Test Image Exists - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - exists: ${{ steps.check-image.outputs.exists }} - steps: - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 - with: - repository: chainlink-solana-tests - tag: ${{ needs.get_solana_sha.outputs.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - solana-build-contracts: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Artifacts - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - changes, - get_projectserum_version, - solana-test-image-exists, - get_solana_sha, - ] - steps: - - name: Collect Metrics - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-solana-build-contracts - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Solana Build Artifacts - continue-on-error: true - - name: Checkout the solana repo - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Build contracts - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 - with: - ref: ${{ needs.get_solana_sha.outputs.sha }} - image: backpackapp/build - image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} - - solana-build-test-image: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Test Image - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - solana-build-contracts, - solana-test-image-exists, - changes, - get_solana_sha, - ] - env: - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Collect Metrics - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-solana-build-test-image - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Solana Build Test Image - continue-on-error: true - - name: Checkout the repo - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Build Test Image - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 - with: - tag: ${{ needs.get_solana_sha.outputs.sha }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - run: echo "this exists so we don't have to run anything else if the build is skipped" - if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' - - solana-smoke-tests: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Smoke Tests - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - build-chainlink, - solana-build-contracts, - solana-build-test-image, - changes, - get_solana_sha, - ] - env: - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Collect Metrics - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1 - with: - id: ${{ env.COLLECTION_ID }}-solana-e2e-tests - org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} - this-job-name: Solana Smoke Tests - test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' - continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Run Setup - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 - with: - go_mod_path: ./integration-tests/go.mod - cache_restore_only: true - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Pull Artifacts - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - run: | - IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} - # Pull the Docker image - docker pull "$IMAGE_NAME" - - # Create a container without starting it - CONTAINER_ID=$(docker create "$IMAGE_NAME") - - # Copy the artifacts from the container - mkdir -p ./${{env.CONTRACT_ARTIFACTS_PATH}}/ - docker cp "$CONTAINER_ID:/go/testdir/${{env.CONTRACT_ARTIFACTS_PATH}}/" "./${{env.CONTRACT_ARTIFACTS_PATH}}/../" - - # Remove the created container - docker rm "$CONTAINER_ID" - - name: Install Solana CLI # required for ensuring the local test validator is configured correctly - run: ./scripts/install-solana-ci.sh - - - name: Install gauntlet - run: | - yarn --cwd ./gauntlet install --frozen-lockfile - yarn --cwd ./gauntlet build - yarn --cwd ./gauntlet gauntlet - - name: Generate config overrides - run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md - cat << EOF > config.toml - [ChainlinkImage] - version="${{ inputs.evm-ref || github.sha }}" - [Common] - user="${{ github.actor }}" - internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" - EOF - # shellcheck disable=SC2002 - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - # shellcheck disable=SC2086 - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - # shellcheck disable=SC2086 - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run Tests - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 - with: - test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - publish_check_name: Solana Smoke Test Results - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: solana-test-artifacts - artifacts_location: | - ./integration-tests/smoke/logs - ./integration-tests/smoke/db_dumps - ./integration-tests/smoke/seth_artifacts - /tmp/gotest.log - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - run_setup: false - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - env: - E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret - - - name: Upload Coverage Data - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl_node_coverage_data_solana_tests - path: .covdata - retention-days: 1