Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 0 additions & 159 deletions .github/workflows/ccip-integration-test.yml

This file was deleted.

146 changes: 72 additions & 74 deletions .github/workflows/test-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,92 @@ name: Run TON Smoke Tests
on:
push:
branches:
- main
- main
pull_request:
schedule:
- cron: '0 3 * * *' # runs each night at 03:00UTC
- cron: "0 3 * * *" # runs each night at 03:00 UTC

jobs:
run-ton-smoke-tests:
name: Run TON Smoke Tests in Chainlink CCIP
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Set Chainlink version
id: set-version-chainlink
run: |
# Default to the pinned version for PRs
CHAINLINK_VERSION=$(cat ./scripts/.core_version | tr -d '[:space:]')
- name: Checkout Repository
uses: actions/checkout@v5
- name: Set Chainlink version
id: set-version-chainlink
run: |
# Default to the pinned version for PRs
CHAINLINK_VERSION=$(cat ./scripts/.core_version | tr -d '[:space:]')

# If this is a scheduled (nightly) run, switch to develop
if [[ "${{ github.event_name }}" == "schedule" ]]; then
CHAINLINK_VERSION="develop"
fi
# If this is a scheduled (nightly) run, switch to develop
if [[ "${{ github.event_name }}" == "schedule" ]]; then
CHAINLINK_VERSION="develop"
fi

echo "chainlink_version=$CHAINLINK_VERSION" >> "$GITHUB_OUTPUT"
- name: Set Chainlink TON version
id: set-version-chainlink-ton
run: |
# Default to the pinned version for PRs
CHAINLINK_TON_VERSION=$(cat ./scripts/.chainlink-ton_version | tr -d '[:space:]')
echo "chainlink_version=$CHAINLINK_VERSION" >> "$GITHUB_OUTPUT"
- name: Set Chainlink TON version
id: set-version-chainlink-ton
run: |
# Default to the pinned version for PRs
CHAINLINK_TON_VERSION=$(cat ./scripts/.chainlink-ton_version | tr -d '[:space:]')

# If this is a scheduled (nightly) run, switch to develop OR if the CHAINLINK_TON_VERSION
# environment variable is empty/unset.
if [[ "${{ github.event_name }}" == "schedule" || -z "$CHAINLINK_TON_VERSION" ]]; then
CHAINLINK_TON_VERSION="${{ github.head_ref || github.sha }}"
fi
# Use the pinned version by default.
# For PRs, use the PR head branch.
# For scheduled runs, use the current repository SHA from the default branch.
# If the pinned version file is empty, also fall back to the current ref/SHA.
if [[ "${{ github.event_name }}" == "schedule" || -z "$CHAINLINK_TON_VERSION" ]]; then
CHAINLINK_TON_VERSION="${{ github.head_ref || github.sha }}"
fi

echo "chainlink-ton_version=$CHAINLINK_TON_VERSION" >> "$GITHUB_OUTPUT"
- name: Setup GitHub Token
id: setup-github-token
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/1.0.0
with:
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_WORKFLOWS_CHAINLINKCCIP }}
aws-lambda-url: ${{ secrets.AWS_LAMBDA_URL_GATI_CHAINLINKCCIP }}
aws-region: ${{ vars.AWS_REGION }}
aws-role-duration-seconds: "1800"
- name: Trigger Chainlink CCIP TON Smoke Tests
env:
GH_TOKEN: ${{ steps.setup-github-token.outputs.access-token }}
# Deployment configuration
WORKFLOW_FILE: .github/workflows/test_smoke.yml
TARGET_REPO: smartcontractkit/chainlink-ccip
TARGET_BRANCH: chains-evm-go-mod # TODO: pin back to main once https://github.com/smartcontractkit/chainlink-ccip/pull/1972 is merged
TON_REF: ${{steps.set-version-chainlink-ton.outputs.chainlink-ton_version}}
CHAINLINK_VERSION: ${{steps.set-version-chainlink.outputs.chainlink_version}}
# relative to chainlink-ccip/devenv. Assumes chainlink-ton is checked out to top level
CUSTOM_CONFIG: env.toml,env-cl-rebuild-ci.toml,../chainlink-ton/devenv/ton.toml
CONTRACT_VERSION: local
run: |
fetch_id() {
gh run list \
echo "chainlink-ton_version=$CHAINLINK_TON_VERSION" >> "$GITHUB_OUTPUT"
- name: Setup GitHub Token
id: setup-github-token
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/1.0.0
with:
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_WORKFLOWS_CHAINLINKCCIP }}
aws-lambda-url: ${{ secrets.AWS_LAMBDA_URL_GATI_CHAINLINKCCIP }}
aws-region: ${{ vars.AWS_REGION }}
aws-role-duration-seconds: "1800"
- name: Trigger Chainlink CCIP TON Smoke Tests
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo we should eventually restructure this workfllow and run tests locally in this repo (import ccip, import devenv, import test, setup, run) vs triggering a workflow in another repo

env:
GH_TOKEN: ${{ steps.setup-github-token.outputs.access-token }}
WORKFLOW_FILE: .github/workflows/test_smoke.yml
TARGET_REPO: smartcontractkit/chainlink-ccip
TARGET_BRANCH: chains-evm-go-mod # TODO: pin back to main once https://github.com/smartcontractkit/chainlink-ccip/pull/1972 is merged
TON_REF: ${{ steps.set-version-chainlink-ton.outputs.chainlink-ton_version }}
CHAINLINK_VERSION: ${{ steps.set-version-chainlink.outputs.chainlink_version }}
CUSTOM_CONFIG: env.toml,env-cl-rebuild-ci.toml,../chainlink-ton/devenv/ton.toml
CONTRACT_VERSION: local
run: |
set -euo pipefail

OUTPUT=$(gh workflow run "${WORKFLOW_FILE}" \
--repo "${TARGET_REPO}" \
--workflow test_smoke.yml \
--branch "${TARGET_BRANCH}" \
--status in_progress \
--json databaseId \
--limit 1 \
--jq '.[0].databaseId'
}
current_run_id=$(fetch_id)
gh workflow run "${WORKFLOW_FILE}" \
--repo "${TARGET_REPO}" \
--ref "${TARGET_BRANCH}" \
--field "ton_ref=${TON_REF}" \
--field "chainlink_version=${CHAINLINK_VERSION}" \
--field "contract_version=${CONTRACT_VERSION}" \
--field "custom_config=${CUSTOM_CONFIG}"

new_run_id=""
while [ -z "$new_run_id" ] || [ "$new_run_id" == "$current_run_id" ]; do
echo "Waiting for new workflow run to start..."
sleep 10
new_run_id=$(fetch_id)
done
RUN_ID=$new_run_id
--ref "${TARGET_BRANCH}" \
--field "ton_ref=${TON_REF}" \
--field "chainlink_version=${CHAINLINK_VERSION}" \
--field "contract_version=${CONTRACT_VERSION}" \
--field "custom_config=${CUSTOM_CONFIG}")

echo "$OUTPUT"

RUN_ID=$(printf '%s\n' "$OUTPUT" \
| grep -Eo 'https://github.com/[^ ]+/actions/runs/[0-9]+' \
| grep -Eo '[0-9]+' \
| tail -n 1)

echo "Triggered workflow run: https://github.com/${TARGET_REPO}/actions/runs/${RUN_ID}"
if [[ -z "${RUN_ID:-}" ]]; then
echo "Failed to parse workflow run ID from gh workflow run output"
exit 1
fi

# Watch the run until complete
gh run watch --repo "${TARGET_REPO}" $RUN_ID --exit-status
echo "Triggered workflow run: https://github.com/${TARGET_REPO}/actions/runs/${RUN_ID}"

gh run watch \
--repo "${TARGET_REPO}" \
"$RUN_ID" \
--exit-status
Loading
Loading