Skip to content

CCIP-1184 Reduce number of logs to be scanned when checking for cache staleness #1663

CCIP-1184 Reduce number of logs to be scanned when checking for cache staleness

CCIP-1184 Reduce number of logs to be scanned when checking for cache staleness #1663

name: Integration Tests
on:
merge_group:
pull_request:
schedule:
- cron: "0 0 * * *"
# - cron: "0 * * * *" # DEBUG: Run every hour to nail down flakes
push:
tags:
- "*"
# Only run 1 of this workflow at a time per PR
concurrency:
group: integration-tests-chainlink-${{ github.ref }}
cancel-in-progress: true
env:
# for run-test variables and environment
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-ccip-tests:${{ github.sha }}
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
TEST_SUITE: smoke
TEST_ARGS: -test.timeout 12m
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
MOD_CACHE_VERSION: 2
jobs:
changes:
environment: integration
name: Check Paths That Require Tests To Run
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
src:
- '**/*.go'
- '**/*go.sum'
- '**/*go.mod'
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/config/**/*.toml'
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Check Paths That Require Tests To Run
continue-on-error: true
outputs:
src: ${{ steps.changes.outputs.src }}
build-chainlink:
environment: integration
permissions:
id-token: write
contents: read
strategy:
matrix:
image:
- name: ""
dockerfile: core/chainlink.Dockerfile
tag-suffix: ""
- name: (plugins)
dockerfile: plugins/chainlink.Dockerfile
tag-suffix: -plugins
name: Build Chainlink Image ${{ matrix.image.name }}
runs-on: ubuntu20.04-16cores-64GB
needs: [changes]
steps:
- name: Collect Metrics
if: needs.changes.outputs.src == 'true'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Build Chainlink Image ${{ matrix.image.name }}
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Check if image exists
if: needs.changes.outputs.src == 'true'
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
repository: chainlink
tag: ${{ github.sha }}${{ matrix.image.tag-suffix }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false' && needs.changes.outputs.src == 'true'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.sha }}
should_checkout: 'false'
cl_dockerfile: ${{ matrix.image.dockerfile }}
push_tag: ${{ env.CHAINLINK_IMAGE }}:${{ github.sha }}${{ matrix.image.tag-suffix }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Print Chainlink Image Built
if: needs.changes.outputs.src == 'true'
run: |
echo "### Chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY
echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY
build-test-image:
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'schedule' || contains(join(github.event.pull_request.labels.*.name, ' '), 'build-test-image')
environment: integration
permissions:
id-token: write
contents: read
name: Build Test Image
runs-on: ubuntu20.04-16cores-64GB
needs: [changes]
steps:
- name: Collect Metrics
if: needs.changes.outputs.src == 'true'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Build Test Image
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Build Test Image
if: needs.changes.outputs.src == 'true'
uses: ./.github/actions/build-test-image
with:
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 }}
# compare-tests:
# needs: [changes]
# runs-on: ubuntu-latest
# name: Compare/Build Automation Test List
# outputs:
# matrix: ${{ env.MATRIX_JSON }}
# steps:
# - name: Check for Skip Tests Label
# if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests')
# run: |
# echo "## \`skip-smoke-tests\` label is active, skipping E2E smoke tests" >>$GITHUB_STEP_SUMMARY
# exit 0
# - name: Checkout the repo
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# - name: Compare Test Lists
# run: |
# cd ./integration-tests
# ./scripts/compareTestList.sh ./smoke/automation_test.go
# ./scripts/compareTestList.sh ./smoke/keeper_test.go
# - name: Build Test Matrix Lists
# id: build-test-matrix-list
# run: |
# cd ./integration-tests
# MATRIX_JSON_AUTOMATION=$(./scripts/buildTestMatrixList.sh ./smoke/automation_test.go automation ubuntu20.04-8cores-32GB 1)
# MATRIX_JSON_KEEPER=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu20.04-8cores-32GB 1)
# COMBINED_ARRAY=$(jq -c -n "$MATRIX_JSON_AUTOMATION + $MATRIX_JSON_KEEPER")
# echo "MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
# eth-smoke-tests-matrix-automation:
# 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
# needs: [build-chainlink, changes, compare-tests]
# env:
# SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
# CHAINLINK_COMMIT_SHA: ${{ github.sha }}
# CHAINLINK_ENV_USER: ${{ github.actor }}
# TEST_LOG_LEVEL: debug
# strategy:
# fail-fast: false
# matrix:
# product: ${{fromJson(needs.compare-tests.outputs.matrix)}}
# runs-on: ${{ matrix.product.os }}
# name: ETH Smoke Tests ${{ matrix.product.name }}
# steps:
# - name: Checkout the repo
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
# - name: Build Go Test Command
# id: build-go-test-command
# run: |
# # if the matrix.product.run is set, use it for a different command
# if [ "${{ matrix.product.run }}" != "" ]; then
# echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT"
# else
# echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT"
# fi
# ## Run this step when changes that require tests to be run are made
# - name: Run Tests
# if: needs.changes.outputs.src == 'true'
# uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
# env:
# PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
# PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }}
# PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
# with:
# test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
# test_download_vendor_packages_command: cd ./integration-tests && go mod download
# cl_repo: ${{ env.CHAINLINK_IMAGE }}
# cl_image_tag: ${{ github.sha }}
# aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
# artifacts_location: ./integration-tests/smoke/logs/
# publish_check_name: ${{ matrix.product.name }}
# token: ${{ secrets.GITHUB_TOKEN }}
# go_mod_path: ./integration-tests/go.mod
# cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
# cache_restore_only: "true"
# QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
# QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
# QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
# - name: Collect Metrics
# if: always()
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: ETH Smoke Tests ${{ matrix.product.name }}
# test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
# continue-on-error: true
eth-smoke-tests-matrix:
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
needs: [build-chainlink, changes]
env:
SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
strategy:
fail-fast: false
matrix:
product:
- name: ccip-smoke
nodes: 1
os: ubuntu20.04-16cores-64GB
file: ccip
dir: ccip-tests/smoke
run: -run ^TestSmokeCCIPForBidirectionalLane$
- name: ccip-smoke-rate-limit
nodes: 1
dir: ccip-tests/smoke
os: ubuntu20.04-16cores-64GB
file: ccip
run: -run ^TestSmokeCCIPRateLimit$
- name: ccip-smoke-multicall
nodes: 1
dir: ccip-tests/smoke
os: ubuntu20.04-16cores-64GB
file: ccip
run: -run ^TestSmokeCCIPMulticall$
- name: cron
nodes: 1
os: ubuntu-latest
pyroscope_env: ""
- name: flux
nodes: 1
os: ubuntu-latest
pyroscope_env: ""
- name: ocr
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr2
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-ocr2-evm-simulated
- name: ocr2
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-ocr2-evm-simulated
tag_suffix: "-plugins"
- name: runlog
nodes: 1
os: ubuntu-latest
pyroscope_env: ""
- name: vrf
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-vrf-evm-simulated
- name: vrfv2
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-vrf2-evm-simulated
- name: vrfv2plus
nodes: 1
os: ubuntu-latest
pyroscope_env: ci-smoke-vrf2plus-evm-simulated
- name: forwarder_ocr
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated
- name: forwarders_ocr2
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated
runs-on: ${{ matrix.product.os }}
name: ETH Smoke Tests ${{ matrix.product.name }}${{ matrix.product.tag_suffix }}
steps:
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Build Go Test Command
id: build-go-test-command
run: |
# if dir is provided use it, otherwise use the smoke dir
if [ "${{ matrix.product.dir }}" != "" ]; then
dir=${{ matrix.product.dir }}
else
dir=smoke
fi
# if the matrix.product.run is set, use it for a different command
if [ "${{ matrix.product.run }}" != "" ]; then
echo "run_command=${{ matrix.product.run }} ./${dir}/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT"
else
echo "run_command=./${dir}/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT"
fi
- name: Check for "enable tracing" label
id: check-label
run: |
label=$(jq -r '.pull_request.labels[]?.name // empty' "$GITHUB_EVENT_PATH")
if [[ -n "$label" ]]; then
if [[ "$label" == "enable tracing" ]]; then
echo "Enable tracing label found."
echo "trace=true" >> $GITHUB_OUTPUT
else
echo "Enable tracing label not found."
echo "trace=false" >> $GITHUB_OUTPUT
fi
else
echo "No labels present or labels are null."
echo "trace=false" >> $GITHUB_OUTPUT
fi
- name: Setup Grafana and OpenTelemetry
id: docker-setup
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
run: |
# Create network
docker network create --driver bridge tracing
# Start Grafana
cd ./.github/tracing
docker run -d --network=tracing --name=grafana -p 3000:3000 -v $PWD/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml -e GF_AUTH_ANONYMOUS_ENABLED=true -e GF_AUTH_ANONYMOUS_ORG_ROLE=Admin -e GF_AUTH_DISABLE_LOGIN_FORM=true -e GF_FEATURE_TOGGLES_ENABLE=traceqlEditor grafana/grafana:9.4.3
# Start Tempo
docker run -d --network=tracing --name=tempo -v ./tempo.yaml:/etc/tempo.yaml -v $PWD/tempo-data:/tmp/tempo grafana/tempo:latest -config.file=/etc/tempo.yaml
# Start OpenTelemetry Collector
docker run -d --network=tracing --name=otel-collector -v $PWD/otel-collector.yaml:/etc/otel-collector.yaml -p 4317:4317 otel/opentelemetry-collector:0.61.0 --config=/etc/otel-collector.yaml
- name: Generate port
id: generate-port
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
env:
GITHUB_PR_NUMBER: ${{ github.event.number }}
run: |
PORT_BASE=3001
MAX_PORT=8000
# Use PR number as offset. Given GitHub PRs are incremental, this guarantees uniqueness for at least 5000 PRs.
OFFSET=$GITHUB_PR_NUMBER
echo "PR Number: $OFFSET"
# Ensure that we don't exceed the max port
if (( OFFSET > (MAX_PORT - PORT_BASE) )); then
OFFSET=$((OFFSET % (MAX_PORT - PORT_BASE)))
fi
# Map the offset to the port range
REMOTE_PORT=$((PORT_BASE + OFFSET))
echo "REMOTE_PORT=$REMOTE_PORT" >> $GITHUB_OUTPUT
- name: Reverse SSH Tunneling
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
env:
TRACING_SSH_KEY: ${{ secrets.TRACING_SSH_KEY }}
TRACING_SSH_SERVER: ${{ secrets.TRACING_SSH_SERVER }}
REMOTE_PORT: ${{ steps.generate-port.outputs.REMOTE_PORT }}
run: |
eval $(ssh-agent)
echo "test"
echo "$TRACING_SSH_KEY" | wc -c
echo "$TRACING_SSH_KEY" | tr -d '\r' | wc -c
echo "$TRACING_SSH_KEY" | tr -d '\r' | base64 --decode | ssh-add -
# f: background process
# N: do not execute a remote command
# R: remote port forwarding
ssh -o StrictHostKeyChecking=no -f -N -R $REMOTE_PORT:127.0.0.1:3000 user-gha@$TRACING_SSH_SERVER
echo "To view Grafana locally:"
echo "ssh -N -L 8000:localhost:$REMOTE_PORT user-gha@$TRACING_SSH_SERVER"
echo "Then visit http://localhost:8000 in a browser."
echo "If you are unable to connect, check with the security team that you have access to the tracing server."
- name: Show Grafana Logs
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
run: |
docker logs grafana
docker logs tempo
docker logs otel-collector
- name: Set sleep time to use in future steps
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
run: |
echo "SLEEP_TIME=2400" >> "$GITHUB_ENV"
## Run this step when changes that require tests to be run are made
- name: Run Tests
if: needs.changes.outputs.src == 'true'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
env:
PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }}
PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
with:
test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ github.sha }}${{ matrix.product.tag_suffix }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: ${{ matrix.product.name }}-test-logs
artifacts_location: ./integration-tests/smoke/logs/
publish_check_name: ${{ matrix.product.name }}
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
## Run this step when changes that do not need the test to run are made
- name: Run Setup
if: needs.changes.outputs.src == 'false'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
test_download_vendor_packages_command: cd ./integration-tests && go mod download
go_mod_path: ./integration-tests/go.mod
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ETH Smoke Tests ${{ matrix.product.name }}
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
- name: Keep action running to view traces
if: steps.check-label.outputs.trace == 'true' && matrix.product.name == 'ocr2' && matrix.product.tag_suffix == '-plugins'
run: |
echo "Sleeping for $SLEEP_TIME seconds..."
sleep $SLEEP_TIME
### Used to check the required checks box when the matrix completes
eth-smoke-tests:
if: always()
runs-on: ubuntu-latest
name: ETH Smoke Tests
needs: [eth-smoke-tests-matrix]
steps:
- name: Check smoke test matrix status
if: needs.eth-smoke-tests-matrix.result != 'success'
run: |
echo "${{ needs.eth-smoke-tests-matrix.result }}"
exit 1
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ETH Smoke Tests
matrix-aggregator-status: ${{ needs.eth-smoke-tests-matrix.result }}
continue-on-error: true
cleanup:
name: Clean up integration environment deployments
if: always()
needs: [eth-smoke-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
- 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
- name: Collect Metrics
if: ${{ github.event_name == 'pull_request' }}
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Clean up integration environment deployments
continue-on-error: true
# Run the setup if the matrix finishes but this time save the cache if we have a cache hit miss
# this will also only run if both of the matrix jobs pass
eth-smoke-go-mod-cache:
environment: integration
needs: [eth-smoke-tests]
runs-on: ubuntu20.04-16cores-64GB
name: ETH Smoke Tests Go Mod Cache
continue-on-error: true
steps:
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Run Setup
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
test_download_vendor_packages_command: |
cd ./integration-tests
go mod download
# force download of test dependencies
go test -run=NonExistentTest ./smoke/... || echo "ignore expected test failure"
go_mod_path: ./integration-tests/go.mod
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "false"
### Migration tests
node-migration-tests:
name: Version Migration Tests
environment: integration
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
runs-on: ubuntu-latest
needs: [build-chainlink, changes, build-test-image]
# Only run migration tests on new tags
if: startsWith(github.ref, 'refs/tags/')
env:
SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink
UPGRADE_VERSION: ${{ github.sha }}
UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
TEST_LOG_LEVEL: debug
TEST_SUITE: migration
steps:
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Get Latest Version
id: get_latest_version
run: |
untrimmed_ver=$(curl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --request GET https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .name)
latest_version="${untrimmed_ver:1}"
echo "latest_version=${latest_version} | tee -a $GITHUB_OUTPUT"
- name: Name Versions
run: |
echo "Running migration tests from version '${{ steps.get_latest_version.outputs.latest_version }}' to: '${{ github.sha }}'"
- name: Run Migration Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json ./migration 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ steps.get_latest_version.outputs.latest_version }}
artifacts_location: ./integration-tests/migration/logs
publish_check_name: Node Migration Test Results
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
- name: Upload test log
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: failure()
with:
name: test-log-${{ matrix.product.name }}
path: /tmp/gotest.log
retention-days: 7
continue-on-error: true
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Version Migration Tests
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
# ### Solana Section
# get_solana_sha:
# 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
# - name: Get the sha from go mod
# id: getshortsha
# run: |
# sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version)
# short_sha="${sol_ver##*-}"
# echo "short sha is: ${short_sha}"
# echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT"
# - name: Checkout solana
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# 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}})
# 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# 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@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
# 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: ubuntu20.04-16cores-64GB
# needs:
# [
# changes,
# get_projectserum_version,
# solana-test-image-exists,
# get_solana_sha,
# ]
# container:
# image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }}
# env:
# RUSTUP_HOME: "/root/.rustup"
# FORCE_COLOR: 1
# steps:
# - name: Collect Metrics
# if: needs.changes.outputs.src == 'true'
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: Solana Build Artifacts
# continue-on-error: true
# - name: Checkout the solana repo
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# repository: smartcontractkit/chainlink-solana
# ref: ${{ needs.get_solana_sha.outputs.sha }}
# - name: Build contracts
# if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
# uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@23816fcf7d380a30c87b6d87e4fb0ca94419b259 # stable action on April 17 2023
# with:
# ref: ${{ needs.get_solana_sha.outputs.sha }}
#
# solana-build-test-image:
# environment: integration
# permissions:
# checks: write
# pull-requests: write
# id-token: write
# contents: read
# name: Solana Build Test Image
# runs-on: ubuntu20.04-16cores-64GB
# 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.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: Solana Build Test Image
# continue-on-error: true
# - name: Checkout the repo
# if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# repository: smartcontractkit/chainlink-solana
# ref: 23816fcf7d380a30c87b6d87e4fb0ca94419b259 # swtich back to this after the next solana release${{ needs.get_solana_sha.outputs.sha }}
# - name: Build Test Image
# if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false'
# uses: ./.github/actions/build-test-image
# with:
# tag: ${{ needs.get_solana_sha.outputs.sha }}
# 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 }}
# - run: echo "this exists so we don't have to run anything else if the build is skipped"
# if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true'
#
# solana-smoke-tests-matrix:
# 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
# strategy:
# matrix:
# image:
# - name: (legacy)
# tag-suffix: ""
# - name: (plugins)
# tag-suffix: -plugins
# name: Solana Smoke Tests ${{ matrix.image.name }}
# runs-on: ubuntu20.04-16cores-64GB
# needs:
# [
# build-chainlink,
# solana-build-contracts,
# solana-build-test-image,
# changes,
# get_solana_sha,
# ]
# env:
# CHAINLINK_COMMIT_SHA: ${{ 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.src == 'true'
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: Solana Smoke Tests ${{ matrix.image.name }}
# test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
# continue-on-error: true
# - name: Checkout the repo
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# repository: smartcontractkit/chainlink-solana
# ref: ${{ needs.get_solana_sha.outputs.sha }}
# - name: Run Setup
# if: needs.changes.outputs.src == 'true'
# uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
# 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 }}
# 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 Artfacts
# if: needs.changes.outputs.src == 'true'
# 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: Run Tests
# if: needs.changes.outputs.src == 'true'
# uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
# 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
# cl_repo: ${{ env.CHAINLINK_IMAGE }}
# cl_image_tag: ${{ github.sha }}${{ matrix.image.tag-suffix }}
# artifacts_location: /home/runner/work/chainlink-solana/chainlink-solana/integration-tests/logs
# 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 }}
# QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
# QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
# QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
# run_setup: false
# - name: Upload test log
# uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
# if: failure()
# with:
# name: test-log-solana
# path: /tmp/gotest.log
# retention-days: 7
# continue-on-error: true
#
# ### Used to check the required checks box when the matrix completes
# solana-smoke-tests:
# if: always()
# runs-on: ubuntu-latest
# name: Solana Smoke Tests
# needs: [solana-smoke-tests-matrix]
# steps:
# - name: Check smoke test matrix status
# if: needs.solana-smoke-tests-matrix.result != 'success'
# run: exit 1
# - name: Collect Metrics
# if: always()
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: Solana Smoke Tests
# matrix-aggregator-status: ${{ needs.solana-smoke-tests-matrix.result }}
# continue-on-error: true
# ### End Solana Section
#
# ### Start Live Testnet Section
#
# testnet-smoke-tests-matrix:
# if: ${{ github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }} ## Only run live tests on new tags and nightly
# environment: integration
# permissions:
# checks: write
# pull-requests: write
# id-token: write
# contents: read
# needs: [build-chainlink]
# env:
# SELECTED_NETWORKS: ${{ matrix.testnet }}
# CHAINLINK_COMMIT_SHA: ${{ github.sha }}
# CHAINLINK_ENV_USER: ${{ github.actor }}
# TEST_LOG_LEVEL: debug
# EVM_KEYS: ${{ secrets.QA_EVM_KEYS }}
#
# OPTIMISM_GOERLI_URLS: ${{ secrets.QA_OPTIMISM_GOERLI_URLS }}
# OPTIMISM_GOERLI_HTTP_URLS: ${{ secrets.QA_OPTIMISM_GOERLI_HTTP_URLS }}
#
# ARBITRUM_GOERLI_URLS: ${{ secrets.QA_ARBITRUM_GOERLI_URLS }}
# ARBITRUM_GOERLI_HTTP_URLS: ${{ secrets.QA_ARBITRUM_GOERLI_HTTP_URLS }}
# strategy:
# fail-fast: false
# matrix:
# # NOTE: If changing this matrix, make sure to update the matrix in the testnet-smoke-tests-notify job to be the same
# # otherwise reporting will be broken. Getting a single matrix for multiple jobs is a pain
# # https://github.com/orgs/community/discussions/26284#discussioncomment-3251198
# testnet: [OPTIMISM_GOERLI, ARBITRUM_GOERLI]
# name: Live Testnet Smoke Tests ${{ matrix.testnet }}
# runs-on: ubuntu-latest
# steps:
# - name: Checkout the repo
# uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# with:
# ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
# ## Only run OCR smoke test for now
# - name: Run Tests
# uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
# env:
# PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }}
# PYROSCOPE_ENVIRONMENT: ci-smoke-ocr-evm-${{ matrix.testnet }} # TODO: Only for OCR for now
# PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
# with:
# test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=1 ./smoke/ocr_test.go 2>&1 | tee /tmp/gotest.log | gotestfmt
# test_download_vendor_packages_command: cd ./integration-tests && go mod download
# cl_repo: ${{ env.CHAINLINK_IMAGE }}
# cl_image_tag: ${{ github.sha }}
# aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
# artifacts_location: ./integration-tests/smoke/logs
# publish_check_name: ${{ matrix.testnet }} OCR Smoke Test Results
# token: ${{ secrets.GITHUB_TOKEN }}
# go_mod_path: ./integration-tests/go.mod
# cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
# cache_restore_only: "true"
# QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
# QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
# QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
#
# - name: Collect Metrics
# if: always()
# id: collect-gha-metrics
# uses: smartcontractkit/push-gha-metrics-action@f4d2fcbe12e9e44921e0171d24085ab7d2a30bc9 # v2.0.1
# with:
# basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
# hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
# this-job-name: Live Testnet Smoke Tests ${{ matrix.testnet }}
# test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
# continue-on-error: true
#
# testnet-smoke-tests-notify:
# name: Live Testnet Start Slack Thread
# if: ${{ always() && needs.testnet-smoke-tests-matrix.result != 'skipped' && needs.testnet-smoke-tests-matrix.result != 'cancelled' }}
# environment: integration
# outputs:
# thread_ts: ${{ steps.slack.outputs.thread_ts }}
# permissions:
# checks: write
# pull-requests: write
# id-token: write
# contents: read
# runs-on: ubuntu-latest
# needs: testnet-smoke-tests-matrix
# steps:
# - name: Debug Result
# run: echo ${{needs.testnet-smoke-tests-matrix.result}}
# - name: Main Slack Notification
# uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
# id: slack
# with:
# channel-id: ${{ secrets.QA_SLACK_CHANNEL }}
# payload: |
# {
# "attachments": [
# {
# "color": "${{ needs.testnet-smoke-tests-matrix.result == 'success' && '#2E7D32' || '#C62828' }}",
# "blocks": [
# {
# "type": "header",
# "text": {
# "type": "plain_text",
# "text": "Live Smoke Test Results ${{ needs.testnet-smoke-tests-matrix.result == 'success' && ':white_check_mark:' || ':x:'}}",
# "emoji": true
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>"
# }
# }
# ]
# }
# ]
# }
# env:
# SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
#
# testnet-smoke-tests-results:
# name: Post Live Testnet Smoke Test Results
# if: ${{ always() && needs.testnet-smoke-tests-matrix.result != 'skipped' && needs.testnet-smoke-tests-matrix.result != 'cancelled' }}
# environment: integration
# permissions:
# checks: write
# pull-requests: write
# id-token: write
# contents: read
# runs-on: ubuntu-latest
# needs: testnet-smoke-tests-notify
# strategy:
# fail-fast: false
# matrix:
# # NOTE: If changing this matrix, make sure to update the matrix in the testnet-smoke-tests-matrix job to be the same
# # otherwise reporting will be broken. Getting a single matrix for multiple jobs is a pain
# # https://github.com/orgs/community/discussions/26284#discussioncomment-3251198
# testnet: [OPTIMISM_GOERLI, ARBITRUM_GOERLI]
# steps:
# - name: Get Results
# id: test-results
# run: |
# echo "Querying test results"
#
# echo "status=$(curl \
# -H "Authorization: Bearer ${{ github.token }}" \
# 'https://api.github.com/repos/${{github.repository}}/actions/runs/${{ github.run_id }}/jobs' \
# | jq -r '.jobs[] | select(.name == "Live Testnet Smoke Tests ${{ matrix.testnet}}").steps[] | select(.name == "Run Tests").conclusion')" >> $GITHUB_OUTPUT
#
# echo "status=$(curl \
# -H "Authorization: Bearer ${{ github.token }}" \
# 'https://api.github.com/repos/${{github.repository}}/actions/runs/${{ github.run_id }}/jobs' \
# | jq -r '.jobs[] | select(.name == "Live Testnet Smoke Tests ${{ matrix.testnet}}").steps[] | select(.name == "Run Tests").conclusion')"
# echo "thread_ts=${{ needs.testnet-smoke-tests-notify.outputs.thread_ts }}"
#
# - name: Test Details
# uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
# with:
# channel-id: ${{ secrets.QA_SLACK_CHANNEL }}
# payload: |
# {
# "thread_ts": "${{ needs.testnet-smoke-tests-notify.outputs.thread_ts }}",
# "attachments": [
# {
# "color": "${{ steps.test-results.outputs.status == 'success' && '#2E7D32' || '#C62828' }}",
# "blocks": [
# {
# "type": "header",
# "text": {
# "type": "plain_text",
# "text": "${{ matrix.testnet }} Smoke Test Results ${{ steps.test-results.outputs.status == 'success' && ':white_check_mark:' || ':x:'}}",
# "emoji": true
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "OCR ${{ steps.test-results.outputs.status == 'success' && ':white_check_mark:' || ':x:'}}"
# }
# }
# ]
# }
# ]
# }
# env:
# SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
#
# ### End Live Testnet Section