fmt #4185
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: Naga Health Checks | |
| on: | |
| push: | |
| branches: | |
| - feature/jss-29-feature-add-naga-uptime-bot | |
| # Temporarily disabled schedule; re-enable when satisfied | |
| # schedule: | |
| # - cron: '*/5 * * * *' | |
| workflow_dispatch: | |
| inputs: | |
| naga_branch: | |
| description: 'Branch to run health checks from (optional)' | |
| required: true | |
| default: 'naga' | |
| network: | |
| description: 'Specific network to test (leave empty for all)' | |
| required: false | |
| type: choice | |
| options: | |
| - naga-dev | |
| - naga-test | |
| env: | |
| LIT_STATUS_WRITE_KEY: ${{ secrets.LIT_STATUS_WRITE_KEY }} | |
| LIT_STATUS_BACKEND_URL: ${{ vars.LIT_STATUS_BACKEND_URL }} | |
| jobs: | |
| naga-health-check: | |
| runs-on: ubuntu-latest | |
| environment: Health Check | |
| strategy: | |
| # Don't cancel other network tests if one fails | |
| fail-fast: false | |
| matrix: | |
| network: [naga-dev, naga-test] | |
| env: | |
| NETWORK: ${{ matrix.network }} | |
| LIVE_MASTER_ACCOUNT: ${{ matrix.network == 'naga-dev' && secrets.LIVE_MASTER_ACCOUNT_NAGA_DEV || secrets.LIVE_MASTER_ACCOUNT_NAGA_TEST }} | |
| LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| # If manually triggered and a branch is provided, use it; otherwise use the triggering ref | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.naga_branch || github.ref }} | |
| fetch-depth: 1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.18.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Enable corepack and setup pnpm | |
| run: | | |
| corepack enable | |
| corepack prepare [email protected] --activate | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build project | |
| run: pnpm build | |
| - name: Verify required environment variables | |
| run: | | |
| echo "Checking environment variables for ${{ matrix.network }}..." | |
| if [ -z "${LIVE_MASTER_ACCOUNT}" ]; then | |
| echo "❌ LIVE_MASTER_ACCOUNT is not set for ${{ matrix.network }}" | |
| exit 1 | |
| fi | |
| if [ -z "${LIT_STATUS_WRITE_KEY}" ]; then | |
| echo "❌ LIT_STATUS_WRITE_KEY is not set" | |
| exit 1 | |
| fi | |
| if [ -z "${LIT_STATUS_BACKEND_URL}" ]; then | |
| echo "❌ LIT_STATUS_BACKEND_URL is not set" | |
| exit 1 | |
| fi | |
| echo "✅ All required environment variables are set" | |
| - name: Run health check for ${{ matrix.network }} | |
| # If a specific network is selected via workflow_dispatch input, only run that one | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.network == '' || github.event.inputs.network == matrix.network }} | |
| run: pnpm run ci:health | |
| timeout-minutes: 10 | |
| env: | |
| NETWORK: ${{ matrix.network }} | |
| LIVE_MASTER_ACCOUNT: ${{ matrix.network == 'naga-dev' && secrets.LIVE_MASTER_ACCOUNT_NAGA_DEV || secrets.LIVE_MASTER_ACCOUNT_NAGA_TEST }} | |
| LIT_STATUS_WRITE_KEY: ${{ secrets.LIT_STATUS_WRITE_KEY }} | |
| LIT_STATUS_BACKEND_URL: ${{ vars.LIT_STATUS_BACKEND_URL }} | |
| LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }} | |
| LOG_LEVEL: info | |
| - name: Health check summary | |
| if: always() | |
| run: | | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "✅ Health check passed for ${{ matrix.network }}" | |
| echo "Time: $(date -u +"%Y-%m-%d %H:%M:%S UTC")" | |
| else | |
| echo "❌ Health check failed for ${{ matrix.network }}" | |
| echo "Time: $(date -u +"%Y-%m-%d %H:%M:%S UTC")" | |
| echo "Please check the logs above for details" | |
| fi | |