|
1 | 1 | name: Rust CI - Withdrawals |
2 | | -# TODO ENG-2223: Add migration tests |
3 | 2 |
|
4 | 3 | on: |
5 | 4 | pull_request: |
|
15 | 14 | - main |
16 | 15 | - staging |
17 | 16 |
|
18 | | -concurrency: |
19 | | - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} |
20 | | - cancel-in-progress: true |
21 | | - |
22 | | -env: |
23 | | - CARGO_TERM_COLOR: always |
24 | | - # Make sure CI fails on all warnings, including Clippy lints |
25 | | - RUSTFLAGS: "-Dwarnings" |
26 | | - # Use a shared cache key for all jobs in the same PR/run. Note the usage of `../Cargo.lock` in invocations |
27 | | - # below to check for any changed deps |
28 | | - CACHE_KEY: "ci-${{ github.head_ref || github.ref_name }}" |
29 | | - # Rust version for consistency across jobs |
30 | | - RUST_VERSION: "1.88.0" |
31 | | - # GitHub Container Registry |
32 | | - GITHUB_REGISTRY: ghcr.io |
33 | | - |
34 | 17 | jobs: |
35 | | - e2e-withdrawals: |
36 | | - if: github.event.pull_request.draft == false |
37 | | - name: E2E Withdrawal Tests |
38 | | - runs-on: shared-large-02 |
39 | | - timeout-minutes: 60 |
40 | | - |
41 | | - steps: |
42 | | - - uses: actions/checkout@v4 |
43 | | - with: |
44 | | - fetch-depth: 0 # Required for full diff detection |
45 | | - submodules: recursive |
46 | | - |
47 | | - - name: Determine whether to run Withdrawals & Migration tests |
48 | | - id: diff |
49 | | - run: | |
50 | | - echo "Fetching base ref..." |
51 | | - git fetch origin ${{ github.base_ref }} |
52 | | -
|
53 | | - echo "Collecting changed files..." |
54 | | - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) |
55 | | - echo "$CHANGED_FILES" |
56 | | -
|
57 | | - echo "Checking for matches against relevant paths..." |
58 | | - PATHS=( |
59 | | - "synd-withdrawals/" |
60 | | - "synd-contracts/src/withdrawal/" |
61 | | - "test-framework/tests/e2e/e2e_tests_withdrawals.rs" |
62 | | - "synd-migration-cli/" |
63 | | - "synd-mchain" |
64 | | - "test-framework/tests/e2e/e2e_tests_migration.rs" |
65 | | - "shared/" |
66 | | - ) |
67 | | -
|
68 | | - run_tests=false |
69 | | - for path in "${PATHS[@]}"; do |
70 | | - if echo "$CHANGED_FILES" | grep -q "^$path"; then |
71 | | - echo "Match found: $path" |
72 | | - run_tests=true |
73 | | - break |
74 | | - fi |
75 | | - done |
76 | | -
|
77 | | - echo "run_tests=$run_tests" >> "$GITHUB_OUTPUT" |
78 | | -
|
79 | | - - name: Skip notice |
80 | | - if: steps.diff.outputs.run_tests == 'false' |
81 | | - run: echo "No relevant files changed — skipping E2E withdrawal & migration tests." |
82 | | - |
83 | | - # All remaining steps are conditional on whether the withdrawals related files were modified |
84 | | - |
85 | | - - name: Install Rust toolchain |
86 | | - if: steps.diff.outputs.run_tests == 'true' |
87 | | - uses: dtolnay/rust-toolchain@stable |
88 | | - with: |
89 | | - toolchain: ${{ env.RUST_VERSION }} |
90 | | - components: "cargo, rustc, clippy, llvm-tools, rustc-dev" |
91 | | - |
92 | | - - name: Cache dependencies |
93 | | - if: steps.diff.outputs.run_tests == 'true' |
94 | | - uses: Swatinem/rust-cache@v2 |
95 | | - with: |
96 | | - shared-key: ${{ env.CACHE_KEY }}-${{ hashFiles('**/Cargo.toml') }} |
97 | | - save-if: "false" |
98 | | - |
99 | | - - name: Install Foundry |
100 | | - if: steps.diff.outputs.run_tests == 'true' |
101 | | - uses: foundry-rs/foundry-toolchain@v1 |
102 | | - with: |
103 | | - version: v1.3.5 |
104 | | - |
105 | | - - name: Pre-download docker test docker images |
106 | | - if: steps.diff.outputs.run_tests == 'true' |
107 | | - run: | |
108 | | - docker pull ghcr.io/syndicateprotocol/generate_batch |
109 | | - docker pull valkey/valkey:latest |
110 | | -
|
111 | | - - name: Install nextest |
112 | | - if: steps.diff.outputs.run_tests == 'true' |
113 | | - uses: taiki-e/install-action@nextest |
114 | | - |
115 | | - # TODO ENG-2223: Enable CI migration tests |
116 | | - - name: Run E2E withdrawal & migration tests |
117 | | - if: steps.diff.outputs.run_tests == 'true' |
118 | | - run: | |
119 | | - # sets debug logs for all syndicate services and info for everything else |
120 | | - RUST_LOG="common=debug,shared=debug,synd_batch_sequencer=debug,synd_block_builder=debug,synd_chain_ingestor=debug,synd_maestro=debug,synd_mchain=debug,synd_slotter=debug,synd_tee_attestation_zk_proofs_aws_nitro=debug,synd_tee_attestation_zk_proofs_sp1_script=debug,synd_tee_attestation_zk_proofs_submitter=debug,synd_translator=debug,test_framework=debug,test_utils=debug,info" \ |
121 | | - RUST_LOG_DISABLE_JSON="true" \ |
122 | | - RUST_LOG_DISABLE_TELEMETRY="true" \ |
123 | | - cargo build && cargo nextest run -p test-framework -E 'test(e2e_tee_withdrawal)' --test-threads=1 |
124 | | -
|
125 | | - # Needs to be the last job step |
126 | | - - name: Notify Slack on Failure |
127 | | - # Only notify for workflow_run failures on main branch (not PRs) |
128 | | - if: failure() && github.ref_name == 'main' |
129 | | - uses: rtCamp/action-slack-notify@v2 |
130 | | - env: |
131 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} |
132 | | - SLACK_COLOR: "danger" |
133 | | - SLACK_MESSAGE: ":x: `${{github.workflow}}` failed on `main` branch. View failure information here: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>" |
134 | | - SLACK_TITLE: "`${{github.workflow}}` failed on `main` branch. Notify the author of the latest PR merged to `main`" |
| 18 | + withdrawal-tests: |
| 19 | + uses: ./.github/workflows/rust-ci-long-test.yml |
| 20 | + with: |
| 21 | + test_name: "E2E Withdrawal Tests" |
| 22 | + monitored_paths: '["synd-withdrawals/", "synd-contracts/src/withdrawal/", "test-framework/tests/e2e/e2e_tests_withdrawals.rs", "shared/"]' |
| 23 | + test_filter: "test(e2e_tee_withdrawal)" |
| 24 | + secrets: inherit |
0 commit comments