Refactor/ci-and-browser-tx-building-alignment #88
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: CI Smoke (Preprod) | |
| on: | |
| pull_request: | |
| branches: [main, preprod] | |
| deployment_status: | |
| workflow_dispatch: | |
| env: | |
| API_BASE_URL: ${{ secrets.SMOKE_API_BASE_URL }} | |
| SIGNER_MNEMONIC_1: ${{ secrets.SMOKE_SIGNER_MNEMONIC_1 }} | |
| SIGNER_MNEMONIC_2: ${{ secrets.SMOKE_SIGNER_MNEMONIC_2 }} | |
| BOT_MNEMONIC: ${{ secrets.SMOKE_BOT_MNEMONIC }} | |
| BOT_KEY_ID: ${{ secrets.SMOKE_BOT_KEY_ID }} | |
| BOT_SECRET: ${{ secrets.SMOKE_BOT_SECRET }} | |
| jobs: | |
| smoke: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # For deployment_status triggers, only run when Railway reports a | |
| # successful deploy to the preprod environment. Other events always run. | |
| if: >- | |
| github.event_name != 'deployment_status' || | |
| (github.event.deployment_status.state == 'success' && | |
| github.event.deployment.creator.login == 'railway-app[bot]' && | |
| contains(github.event.deployment.environment, 'preprod')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # On deployment_status, check out the exact SHA that was deployed. | |
| ref: ${{ github.event.deployment.sha || github.sha }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Check secrets configured | |
| id: check-secrets | |
| run: | | |
| if [ -z "$API_BASE_URL" ]; then | |
| echo "configured=false" >> "$GITHUB_OUTPUT" | |
| echo "Smoke test skipped: SMOKE_* secrets not configured." | |
| else | |
| echo "configured=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Install dependencies | |
| if: steps.check-secrets.outputs.configured == 'true' | |
| run: npm ci | |
| - name: Stage 1 - Bootstrap wallets | |
| if: steps.check-secrets.outputs.configured == 'true' | |
| run: npx tsx scripts/ci-smoke/create-wallets.ts | |
| - name: Stage 2 - Run route chain | |
| if: steps.check-secrets.outputs.configured == 'true' | |
| run: npx tsx scripts/ci-smoke/run-route-chain.ts | |
| - name: Upload smoke artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() && steps.check-secrets.outputs.configured == 'true' | |
| with: | |
| name: smoke-report | |
| path: ci-artifacts/ | |
| retention-days: 14 |