Add WT and DeriveRemaining capability #6170
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: e2e_tests_custom_cl | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
cl_branch_ref: | |
description: Chainlink repo branch to integrate with | |
required: true | |
default: develop | |
type: string | |
team: | |
description: Team to run the tests for (e.g. BIX, CCIP) | |
required: true | |
type: string | |
env: | |
CL_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink | |
CONTRACT_ARTIFACTS_PATH: contracts/target/deploy | |
MOD_CACHE_VERSION: 1 | |
# Only run 1 of this workflow at a time per PR | |
concurrency: | |
group: integration-tests-solana-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_test_compilation: | |
name: Check integration test compilation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
check-latest: true | |
cache: true | |
- run: cd ./integration-tests && go test -run=xxx ./... | |
get_projectserum_version: | |
name: Get ProjectSerum Version | |
environment: integration | |
runs-on: ubuntu-latest | |
outputs: | |
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Get ProjectSerum Version | |
id: psversion | |
uses: ./.github/actions/projectserum_version | |
contract-changes: | |
name: Check for contract changes | |
runs-on: ubuntu-latest | |
outputs: | |
changed: ${{ steps.changes.outputs.contracts }} | |
steps: | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: changes | |
with: | |
base: develop | |
list-files: csv | |
filters: | | |
contracts: | |
- 'contracts/**' | |
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 | |
outputs: | |
exists: ${{ steps.check-image-exists.outputs.exists }} | |
steps: | |
- name: Check if image exists in ECR | |
id: check-image-exists | |
uses: smartcontractkit/.github/actions/ecr-image-exists@ecr-image-exists/0.0.1 | |
with: | |
repository: chainlink-solana-tests | |
tag: ${{ github.sha }} | |
aws-role-arn: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
e2e_custom_build_artifacts: | |
name: E2E Custom Build Artifacts | |
environment: integration | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest-32cores-128GB | |
needs: [get_projectserum_version] | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Build contracts | |
uses: ./.github/actions/build_contract_artifacts | |
with: | |
runner-os: ${{ runner.os }} | |
image: backpackapp/build | |
image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} | |
e2e_custom_build_previous_artifacts: | |
name: E2E Build Previous Release Artifacts | |
environment: integration | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest-32cores-128GB | |
needs: [contract-changes,get_projectserum_version] | |
if: needs.contract-changes.outputs.changed == 'true' | |
steps: | |
- name: Checkout previous release | |
uses: actions/checkout@v4 | |
with: | |
ref: v1.0.2 # set to v1.1.0 after v1.1.0 is deployed to mainnet | |
- name: build contracts | |
id: previous | |
run: | | |
# for use with 1.0.2 release | |
docker run -d -v "$(pwd)":/repo --name build-container projectserum/build:v0.25.0 tail -f /dev/null | |
# for use with 1.1.0 release and onward | |
# docker run -d -v "$(pwd)":/repo --name build-container backpackapp/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} tail -f /dev/null | |
# build with keys | |
docker exec build-container bash -c "\ | |
export RUSTUP_HOME=\"/root/.rustup\" &&\ | |
cd /repo &&\ | |
./scripts/programs-keys-gen.sh &&\ | |
cd ./contracts &&\ | |
anchor build &&\ | |
chown -R $(id -u):$(id -g) /repo" | |
# clean up the container | |
docker stop build-container | |
docker rm build-container | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-previous | |
path: ${{ env.CONTRACT_ARTIFACTS_PATH }} | |
e2e_program_upgrade_generate_artifacts: | |
name: Combine artifacts for upgrade test | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
needs: [contract-changes,e2e_custom_build_artifacts,e2e_custom_build_previous_artifacts] | |
if: needs.contract-changes.outputs.changed == 'true' | |
outputs: | |
changed: ${{ steps.check.outputs.continue }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: ./temp/artifacts | |
- name: hash current artifacts | |
id: current | |
run: | | |
cd ./temp/artifacts # need to be in directory for hashes to compare without path differences | |
# shellcheck disable=SC2035 | |
echo "hash=$(sha1sum * | sha1sum)" >> "$GITHUB_OUTPUT" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifacts-previous | |
path: ./temp/artifacts/previous | |
- name: hash previous artifacts | |
id: previous | |
run: | | |
cd ./temp/artifacts/previous # need to be in directory for hashes to compare without path differences | |
# shellcheck disable=SC2035 | |
echo "hash=$(sha1sum * | sha1sum)" >> "$GITHUB_OUTPUT" | |
- name: compare hashes | |
id: check | |
run: | | |
echo "previous: ${{ steps.previous.outputs.hash }}" | |
echo "current: ${{ steps.current.outputs.hash }}" | |
if [ "${{ steps.previous.outputs.hash }}" != "${{ steps.current.outputs.hash }}" ]; then | |
echo "continue=true" >> "$GITHUB_OUTPUT" | |
fi | |
- uses: actions/upload-artifact@v4 | |
if: steps.check.outputs.continue | |
with: | |
name: artifacts | |
path: ./temp/artifacts/ # combine artifacts | |
overwrite: true | |
get-core-ref: | |
name: Get Core Ref | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
outputs: | |
core-ref: ${{ steps.get-core-ref.outputs.core-ref || github.event.inputs.cl_branch_ref }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Get core ref | |
id: get-core-ref | |
uses: ./.github/actions/get-core-ref | |
e2e_custom_build_custom_chainlink_image: | |
needs: [ get-core-ref ] | |
name: E2E Custom Build Custom CL Image | |
runs-on: ubuntu-latest-16cores-64GB | |
environment: integration | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Check if image exists in ECR | |
id: check-image-exists | |
uses: smartcontractkit/.github/actions/ecr-image-exists@ecr-image-exists/0.0.1 | |
with: | |
repository: "chainlink" | |
tag: solana.${{ github.sha }} | |
aws-role-arn: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
- name: Checkout Chainlink repo | |
if: ${{ steps.check-image-exists.outputs.exists != 'true' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: smartcontractkit/chainlink | |
ref: ${{ needs.get-core-ref.outputs.core-ref }} | |
- name: Build Image | |
if: ${{ steps.check-image-exists.outputs.exists != 'true' }} | |
uses: smartcontractkit/.github/actions/ctf-build-image@ctf-build-image/v1 | |
with: | |
dockerfile: core/chainlink.Dockerfile | |
image-tag: solana.${{ github.sha }} | |
go-get-overrides: | | |
chainlink-solana=${{ github.event.pull_request.head.sha }} | |
# registry inputs | |
aws-role-arn: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.QA_AWS_REGION }} | |
aws-account-number: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} | |
docker-registry-url: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com | |
docker-repository-name: chainlink | |
# GATI inputs | |
gati-role-arn: ${{ secrets.AWS_ROLE_ARN_GATI_READONLY }} | |
gati-lambda-url: ${{ secrets.AWS_RELENG_TEAM_GATI_LAMBDA_URL}} | |
build_test_image: | |
environment: integration | |
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'build-test-image') | |
permissions: | |
id-token: write | |
contents: read | |
name: Build Test Image | |
runs-on: ubuntu-latest | |
needs: [e2e_custom_build_artifacts] | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Build Image | |
uses: ./.github/actions/build-test-image | |
with: | |
artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }} | |
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 }} | |
e2e_custom_run_smoke_tests: | |
name: E2E Custom Run Smoke Tests | |
environment: integration | |
permissions: | |
checks: write | |
pull-requests: write | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest-16cores-64GB | |
needs: [e2e_custom_build_artifacts, e2e_custom_build_custom_chainlink_image, check_test_compilation] | |
env: | |
TEST_SUITE: smoke | |
TEST_ARGS: -test.timeout 30m | |
TEST_LOG_LEVEL: debug | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Install Solana CLI # required for ensuring the local test validator is configured correctly | |
run: ./scripts/install-solana-ci.sh | |
- name: Install gauntlet | |
uses: ./.github/actions/build-gauntlet | |
- name: Generate config overrides | |
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md | |
cat << EOF > config.toml | |
[ChainlinkImage] | |
version="solana.${{ 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 | |
uses: smartcontractkit/.github/actions/ctf-run-tests@91995e4dd053581696702eec503ce2d2c8b8e753 # 0.6.1 | |
with: | |
test_command_to_run: cd ./integration-tests && go test -count=1 -run TestSolanaOCRV2Smoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false | |
test_download_vendor_packages_command: cd ./integration-tests && go mod download | |
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} | |
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }} | |
go_mod_path: ./integration-tests/go.mod | |
cl_repo: ${{ env.CL_ECR }} | |
cl_image_tag: solana.${{ github.sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} | |
artifacts_name: smoke-test-logs | |
artifacts_location: ./integration-tests/smoke/logs/ | |
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
enable-gap: false | |
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }} | |
cache_restore_only: "false" | |
env: | |
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }} | |
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret | |
CHAINLINK_USER_TEAM: ${{ github.event.inputs.team || 'BIX' }} | |
e2e_program_upgrade_tests: | |
name: E2E Program Upgrade Tests | |
environment: integration | |
permissions: | |
checks: write | |
pull-requests: write | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest-16cores-64GB | |
needs: [contract-changes,e2e_program_upgrade_generate_artifacts,e2e_custom_build_custom_chainlink_image, check_test_compilation] | |
if: needs.contract-changes.outputs.changed == 'true' && needs.e2e_program_upgrade_generate_artifacts.outputs.changed == 'true' | |
env: | |
TEST_SUITE: smoke | |
TEST_ARGS: -test.timeout 30m | |
TEST_LOG_LEVEL: debug | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Install Solana CLI # required for ensuring the local test validator is configured correctly | |
run: ./scripts/install-solana-ci.sh | |
- name: Install gauntlet | |
uses: ./.github/actions/build-gauntlet | |
- name: Generate config overrides | |
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md | |
cat << EOF > config.toml | |
[ChainlinkImage] | |
image="${{ env.CL_ECR }}" | |
version="solana.${{ 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 Upgrade Test | |
uses: smartcontractkit/.github/actions/ctf-run-tests@91995e4dd053581696702eec503ce2d2c8b8e753 # 0.6.1 | |
with: | |
test_command_to_run: cd ./integration-tests && go test -count=1 -run TestSolanaOCRV2UpgradeSmoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false | |
test_download_vendor_packages_command: cd ./integration-tests && go mod download | |
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} | |
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }} | |
go_mod_path: ./integration-tests/go.mod | |
cl_repo: ${{ env.CL_ECR }} | |
cl_image_tag: solana.${{ github.sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} | |
artifacts_name: smoke-test-logs | |
artifacts_location: ./integration-tests/smoke/logs/ | |
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} | |
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | |
enable-gap: false | |
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }} | |
cache_restore_only: "false" | |
env: | |
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }} | |
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret | |
CHAINLINK_USER_TEAM: ${{ github.event.inputs.team || 'BIX' }} | |