CCIP Staging Monitor #509
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: CCIP Staging Monitor | |
permissions: | |
contents: read | |
on: | |
schedule: | |
# Runs at minute 0, 15, 30, and 45 of every hour | |
- cron: "*/15 * * * *" | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
branches: | |
- main | |
jobs: | |
monitor-tests: | |
if: | | |
github.event_name == 'schedule' || | |
(github.event_name == 'pull_request' && | |
contains(github.event.pull_request.labels.*.name, 'run-staging-monitor-test')) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Note: add more tests here | |
test: [ | |
ton2evm-messaging, | |
evm2ton-messaging, | |
] | |
env: | |
TON_TESTNET_SELECTOR: ${{ vars.TON_TESTNET_SELECTOR }} | |
ETHEREUM_TESTNET_SEPOLIA_SELECTOR: ${{ vars.ETHEREUM_TESTNET_SEPOLIA_SELECTOR }} | |
TON_TESTNET_ROUTER: ${{ secrets.STAGING_TON_TESTNET_ROUTER }} | |
TON_TESTNET_RECEIVER: ${{ secrets.STAGING_TON_TESTNET_RECEIVER }} | |
TON_TESTNET_WALLET_KEY: ${{ secrets.STAGING_TON_TESTNET_WALLET_KEY }} | |
TON_TESTNET_ENDPOINT: ${{ secrets.STAGING_TON_TESTNET_ENDPOINT }} | |
ETHEREUM_TESTNET_SEPOLIA_ROUTER: ${{ secrets.STAGING_ETHEREUM_TESTNET_SEPOLIA_ROUTER }} | |
ETHEREUM_TESTNET_SEPOLIA_RECEIVER: ${{ secrets.STAGING_ETHEREUM_TESTNET_SEPOLIA_RECEIVER }} | |
ETHEREUM_TESTNET_SEPOLIA_WALLET_KEY: ${{ secrets.STAGING_ETHEREUM_TESTNET_SEPOLIA_WALLET_KEY }} | |
ETHEREUM_TESTNET_SEPOLIA_ENDPOINT: ${{ secrets.STAGING_ETHEREUM_TESTNET_SEPOLIA_ENDPOINT }} | |
MESSAGE: "ccip-staging-${{ github.run_id }}" | |
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
TRIGGER: "${{ github.event_name }}" | |
WHEN: "${{ github.run_started_at }}" # ISO8601 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Run ${{ matrix.test }} test | |
id: test | |
continue-on-error: true | |
run: | | |
cd staging-monitor | |
nix develop -c go run ./cmd/run-test -case ${{ matrix.test }} | |
- name: Send Slack notification | |
if: always() | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.STAGING_TEST_SLACK_WEBHOOK }} | |
run: | | |
cd staging-monitor | |
nix develop -c go run ./cmd/send-slack -webhook-url="$SLACK_WEBHOOK_URL" | |
- name: Fail job if test failed | |
if: always() | |
run: | | |
cd staging-monitor | |
STATUS=$(jq -r '.status' result.json) | |
if [[ "$STATUS" != "success" ]]; then | |
echo "Test failed with status: $STATUS" | |
exit 1 | |
fi |