CCIP TON Staging Monitor #14880
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 TON Staging Monitor | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| # Runs at minute 0, 15, 30, and 45 of every hour | |
| - cron: "*/15 * * * *" | |
| workflow_dispatch: # Manual trigger from GitHub Actions UI | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| branches: | |
| - main | |
| jobs: | |
| ccip-monitor-tests: | |
| # Toggle via CCIP_STAGING_MONITOR_ENABLED variable (set to 'false' to disable) | |
| # Manual triggers (workflow_dispatch) always run regardless of toggle | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (vars.CCIP_STAGING_MONITOR_ENABLED != 'false' && ( | |
| 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: | |
| test: | |
| # Note: add more tests here, see staging-monitor/cmd/run-test/main.go and staging-monitor/README.md | |
| - 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_FEE_QUOTER: ${{ secrets.STAGING_TON_TESTNET_FEE_QUOTER }} | |
| 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@v5 | |
| - 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" -environment Staging | |
| - 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 |