[gql] Widen grpc mask to prefetch additional Transaction content
#109666
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: Rust | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'devnet' | |
| - 'testnet' | |
| - 'mainnet' | |
| - 'releases/sui-*-release' | |
| pull_request: | |
| types: [ opened, synchronize, reopened, ready_for_review ] | |
| workflow_dispatch: | |
| inputs: | |
| sui_repo_ref: | |
| description: "Branch / commit to test" | |
| type: string | |
| required: false | |
| default: '' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Disable incremental compilation. | |
| # | |
| # Incremental compilation is useful as part of an edit-build-test-edit cycle, | |
| # as it lets the compiler avoid recompiling code that hasn't changed. However, | |
| # on CI, we're not making small edits; we're almost always building the entire | |
| # project from scratch. Thus, incremental compilation on CI actually | |
| # introduces *additional* overhead to support making future builds | |
| # faster...but no future builds will ever occur in any given CI environment. | |
| # | |
| # See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | |
| # for details. | |
| CARGO_INCREMENTAL: 0 | |
| # Allow more retries for network requests in cargo (downloading crates) and | |
| # rustup (installing toolchains). This should help to reduce flaky CI failures | |
| # from transient network timeouts or other issues. | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| # Don't emit giant backtraces in the CI logs. | |
| RUST_BACKTRACE: short | |
| # RUSTFLAGS: -D warnings | |
| RUSTDOCFLAGS: -D warnings | |
| # Set log level in CI to error. If you need more information to debug a CI | |
| # failure, change this temporarily and rerun your tests | |
| RUST_LOG: error | |
| # sccache role selection: | |
| # trusted refs (protected + release branches), NOT a workflow_dispatch building | |
| # an override sui_repo_ref → RW role (read/write cache). | |
| # same-repo pull_request → RO role (read-only; a PR cannot poison the cache). | |
| # forks / overrides / everything else → empty → setup-sccache falls back to a | |
| # local cache. Forks are skipped here because GitHub caps fork id-token to | |
| # none, so role-to-assume would hard-fail the OIDC step. This fork skip is a | |
| # fail-safe accommodation, NOT a security boundary — the RO role still trusts | |
| # pull_request, so a fork reading the cache is acceptable (Decision A). | |
| # Keep in sync with the sui-sccache-{rw,ro}-github trust policies. | |
| SCCACHE_ROLE: ${{ (github.event_name != 'workflow_dispatch' || github.event.inputs.sui_repo_ref == '') && (contains(fromJSON('["refs/heads/main","refs/heads/devnet","refs/heads/testnet","refs/heads/mainnet"]'), github.ref) || (startsWith(github.ref, 'refs/heads/releases/sui-') && endsWith(github.ref, '-release'))) && 'arn:aws:iam::011083325127:role/sui-sccache-rw-github' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) && 'arn:aws:iam::011083325127:role/sui-sccache-ro-github' || '' }} | |
| jobs: | |
| diff: | |
| runs-on: [ ubuntu-latest ] | |
| outputs: | |
| isRust: ${{ steps.diff.outputs.isRust }} | |
| isMove: ${{ steps.diff.outputs.isMove }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - name: Detect Changes | |
| uses: './.github/actions/diffs' | |
| id: diff | |
| license-check: | |
| name: license-check | |
| runs-on: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - name: Run license check | |
| run: cargo xlint | |
| - name: Git checks | |
| run: scripts/git-checks.sh | |
| test: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| env: | |
| # Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | |
| # causes #[sim_test] to only run under the deterministic `simtest` job, and not the | |
| # non-deterministic `test` job. | |
| SUI_SKIP_SIMTESTS: 1 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - uses: taiki-e/install-action@protoc | |
| - name: Add postgres to PATH | |
| shell: bash | |
| run: | | |
| pg_bin=$(ls -d /usr/lib/postgresql/*/bin 2>/dev/null | head -1) | |
| [ -n "$pg_bin" ] || { echo "ERROR: no postgres bin dir found under /usr/lib/postgresql"; exit 1; } | |
| echo "$pg_bin" >> "$GITHUB_PATH" | |
| - name: Install BigTable emulator | |
| run: | | |
| echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list | |
| curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg | |
| sudo apt-get update -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/google-cloud-sdk.list -o Dir::Etc::sourceparts=/dev/null | |
| sudo apt-get install -y google-cloud-cli-cbt google-cloud-cli-bigtable-emulator | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: cargo test | |
| run: | | |
| cargo nextest run --profile ci --cargo-quiet -E '!package(sui-bridge) and !package(sui-bridge-indexer)' | |
| # Ensure there are no uncommitted changes in the repo after running tests | |
| - run: scripts/changed-files.sh | |
| shell: bash | |
| test-tidehunter: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| env: | |
| # Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | |
| # causes #[sim_test] to only run under the deterministic `simtest` job, and not the | |
| # non-deterministic `test` job. | |
| SUI_SKIP_SIMTESTS: 1 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - uses: taiki-e/install-action@protoc | |
| - name: Add postgres to PATH | |
| shell: bash | |
| run: | | |
| pg_bin=$(ls -d /usr/lib/postgresql/*/bin 2>/dev/null | head -1) | |
| [ -n "$pg_bin" ] || { echo "ERROR: no postgres bin dir found under /usr/lib/postgresql"; exit 1; } | |
| echo "$pg_bin" >> "$GITHUB_PATH" | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: cargo test with tidehunter | |
| run: | | |
| RUST_BACKTRACE=1 USE_TIDEHUNTER=1 cargo nextest run --profile ci --cargo-quiet -p sui-core -p typed-store --features typed-store/tidehunter | |
| - run: rustup component add clippy | |
| # Same as the main `cargo xclippy` run, denying warnings, but with USE_TIDEHUNTER=1 and | |
| # scoped to the crates whose build.rs emits cfg(tidehunter) so tidehunter-only code is | |
| # linted too. --all-features covers typed-store/tidehunter and sui-tool/tideconsole. | |
| - name: cargo clippy with tidehunter | |
| run: | | |
| USE_TIDEHUNTER=1 cargo xclippy -p sui-core -p sui-tool -p sui-benchmark -p typed-store -p consensus-core -- -D warnings | |
| # Ensure there are no uncommitted changes in the repo after running tests | |
| - run: scripts/changed-files.sh | |
| shell: bash | |
| # This is a no-op job that allows the resulting action names to line up when | |
| # there are no rust changes in a given PR/commit. This ensures that we can | |
| # continue to block on the rust tests passing in the case of rust changes and | |
| # otherwise not block pushes to main. | |
| # Note that this no-op job is only when there is a strategy matrix. | |
| # Other required jobs without strategy matrix do not need a no-op counterpart. | |
| test-tidehunter-notrust: | |
| name: test-tidehunter | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'false' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - run: 'echo "No build required" ' | |
| test-extra: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| env: | |
| # Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | |
| # causes #[sim_test] to only run under the deterministic `simtest` job, and not the | |
| # non-deterministic `test` job. | |
| SUI_SKIP_SIMTESTS: 1 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - uses: taiki-e/install-action@protoc | |
| - name: Add postgres to PATH | |
| shell: bash | |
| run: | | |
| pg_bin=$(ls -d /usr/lib/postgresql/*/bin 2>/dev/null | head -1) | |
| [ -n "$pg_bin" ] || { echo "ERROR: no postgres bin dir found under /usr/lib/postgresql"; exit 1; } | |
| echo "$pg_bin" >> "$GITHUB_PATH" | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: cargo test (sui-graphql staging) | |
| run: | | |
| cargo nextest run --profile ci --cargo-quiet --features staging -E 'package(sui-indexer-alt-graphql) or (package(sui-indexer-alt-e2e-tests) and binary(graphql_subscription))' | |
| - name: doctests | |
| run: | | |
| cargo test --doc | |
| - name: rustdoc | |
| run: | | |
| cargo doc --workspace --no-deps | |
| - name: Install cargo-hakari, and cache the binary | |
| uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # pin@v3.0.0 | |
| with: | |
| crate: cargo-hakari | |
| locked: true | |
| - name: Install rustfmt | |
| run: rustup component add rustfmt | |
| - name: sui-execution | |
| run: | | |
| ./scripts/execution_layer.py generate-lib | |
| - name: Install diesel CLI | |
| uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # pin@v3.0.0 | |
| with: | |
| crate: diesel_cli | |
| version: '=2.2.6' | |
| locked: true | |
| args: --no-default-features | |
| features: postgres | |
| - name: Indexer Alt schema | |
| run: | | |
| ./crates/sui-indexer-alt-schema/generate_schema.sh | |
| - name: Indexer Alt Framework schema | |
| run: | | |
| ./crates/sui-pg-db/generate_schema.sh | |
| cargo fmt -- crates/sui-pg-db/src/schema.rs | |
| # Ensure there are no uncommitted changes in the repo after running tests | |
| - run: scripts/changed-files.sh | |
| shell: bash | |
| benchmark-smoke: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| name: benchmark (smoke) | |
| needs: [diff, rustfmt, clippy] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| runs-on: [ ubuntu-ghcloud ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: Build sui and stress binaries | |
| run: | | |
| cargo build --release --package sui --package sui-benchmark --bin sui --bin stress | |
| - name: Start local Sui network | |
| run: | | |
| set -euo pipefail | |
| CFG=$(mktemp -d) | |
| target/release/sui genesis -f --working-dir "$CFG" | |
| target/release/sui start --network.config "$CFG" & | |
| SUI_PID=$! | |
| for i in $(seq 1 60); do | |
| if curl -sf -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"rpc.discover","id":1}' http://127.0.0.1:9000 -o /dev/null 2>&1; then echo "RPC is ready"; break; fi | |
| if ! kill -0 $SUI_PID 2>/dev/null; then echo "sui start died"; exit 1; fi | |
| sleep 2 | |
| done | |
| curl -sf -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"rpc.discover","id":1}' http://127.0.0.1:9000 -o /dev/null || { echo "RPC not ready after 120s"; exit 1; } | |
| echo "SUI_PID=$SUI_PID" >> "$GITHUB_ENV" | |
| echo "SUI_CONFIG_DIR=$CFG" >> "$GITHUB_ENV" | |
| - name: sui-benchmark stress (smoke) | |
| run: | | |
| set -euo pipefail | |
| ADDR=$(grep active_address "$SUI_CONFIG_DIR/client.yaml" | awk '{print $2}' | tr -d '"') | |
| target/release/stress \ | |
| --fullnode-rpc-addresses http://127.0.0.1:9000 \ | |
| --genesis-blob-path "$SUI_CONFIG_DIR/genesis.blob" \ | |
| --keystore-path "$SUI_CONFIG_DIR/sui.keystore" \ | |
| --primary-gas-owner-id "$ADDR" \ | |
| --use-fullnode-for-execution true \ | |
| --num-client-threads 10 --num-server-threads 24 \ | |
| --num-transfer-accounts 2 --run-duration 10s --min-tps 0.01 \ | |
| bench --target-qps 10 --num-workers 10 \ | |
| --transfer-object 1 --shared-counter 1 --delegation 1 \ | |
| --batch-payment 1 --shared-deletion 1 --randomness 1 \ | |
| --expected-failure 1 --randomized-transaction 1 \ | |
| --slow 1 --party 1 --composite 1 | |
| kill $SUI_PID 2>/dev/null || true | |
| - name: consensus benchmark (smoke) | |
| run: | | |
| cargo bench --package consensus-core --bench commit_finalizer_bench -- --test | |
| windows-build: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| runs-on: [ windows-ghcloud-128 ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: windows-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - name: cargo build | |
| shell: bash | |
| run: | | |
| cargo build --all-features | |
| windows-cli-tests: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff] | |
| if: needs.diff.outputs.isRust == 'true' | |
| timeout-minutes: 45 | |
| runs-on: [ windows-ghcloud-128 ] | |
| env: | |
| # Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var | |
| # causes #[sim_test] to only run under the deterministic `simtest` job, and not the | |
| # non-deterministic `test` job. | |
| SUI_SKIP_SIMTESTS: 1 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: windows-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - name: cargo test Sui CLI | |
| shell: bash | |
| run: | | |
| # We have temporarily disabled the network tests on windows, until we triage + fix the performance issues. | |
| cargo nextest run -p sui --no-fail-fast --profile ci --cargo-quiet --filter-expr "not test(shell_tests::with_network)" | |
| simtest: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' || needs.diff.outputs.isSolidity == 'true' | |
| timeout-minutes: 45 | |
| runs-on: [ ubuntu-ghcloud ] | |
| env: | |
| MSIM_WATCHDOG_TIMEOUT_MS: 300000 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - uses: taiki-e/install-action@protoc | |
| - name: Add postgres to PATH | |
| shell: bash | |
| run: | | |
| pg_bin=$(ls -d /usr/lib/postgresql/*/bin 2>/dev/null | head -1) | |
| [ -n "$pg_bin" ] || { echo "ERROR: no postgres bin dir found under /usr/lib/postgresql"; exit 1; } | |
| echo "$pg_bin" >> "$GITHUB_PATH" | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: cargo simtest | |
| run: | | |
| MSIM_TEST_SEED="$(printf "%lu\n" 0x$(git rev-parse HEAD | cut -c1-16))" scripts/simtest/cargo-simtest simtest --profile ci --cargo-quiet --no-fail-fast | |
| - name: check determinism | |
| run: | | |
| MSIM_TEST_SEED="$(printf "%lu\n" 0x$(git rev-parse HEAD | cut -c1-16))" scripts/simtest/check-determinism.sh | |
| simtest-mainnet: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' || needs.diff.outputs.isSolidity == 'true' | |
| timeout-minutes: 45 | |
| runs-on: [ ubuntu-ghcloud ] | |
| env: | |
| MSIM_WATCHDOG_TIMEOUT_MS: 300000 | |
| SUI_PROTOCOL_CONFIG_CHAIN_OVERRIDE: mainnet | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - uses: taiki-e/install-action@protoc | |
| - name: Add postgres to PATH | |
| shell: bash | |
| run: | | |
| pg_bin=$(ls -d /usr/lib/postgresql/*/bin 2>/dev/null | head -1) | |
| [ -n "$pg_bin" ] || { echo "ERROR: no postgres bin dir found under /usr/lib/postgresql"; exit 1; } | |
| echo "$pg_bin" >> "$GITHUB_PATH" | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 # pin@master | |
| with: | |
| swap-size-gb: 256 | |
| - name: cargo simtest | |
| run: | | |
| MSIM_TEST_SEED="$(printf "%lu\n" 0x$(git rev-parse HEAD | cut -c1-16))" scripts/simtest/cargo-simtest simtest --profile ci --cargo-quiet --no-fail-fast | |
| # This job ensures that Move unit tests are run if there are changes | |
| # to Move code but not Rust code (If there are Rust changes, they | |
| # will be run as part of a larger test suite). | |
| move-test: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' | |
| timeout-minutes: 10 | |
| runs-on: [ ubuntu-ghcloud ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - uses: taiki-e/install-action@nextest | |
| - name: Run move tests | |
| run: | | |
| cargo nextest run --profile ci --cargo-quiet -p sui-framework-tests --test move_tests | |
| # # Disabled | |
| # rosetta-validation: | |
| # needs: diff | |
| # if: needs.diff.outputs.isRust == 'true' | |
| # timeout-minutes: 45 | |
| # runs-on: [ubuntu-ghcloud] | |
| # steps: | |
| # - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 | |
| # with: | |
| # ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| # - name: Setup environment | |
| # run: .github/scripts/rosetta/setup.sh | |
| # shell: bash | |
| # - name: Start local Sui network | |
| # run: | | |
| # sui start --no-full-node & | |
| # shell: bash | |
| # - name: Start Rosetta servers | |
| # run: .github/scripts/rosetta/start_rosetta.sh | |
| # shell: bash | |
| # - name: Sleep for 20 seconds | |
| # run: sleep 20s | |
| # shell: bash | |
| # - name: Run check:construction test | |
| # run: | | |
| # ./bin/rosetta-cli --configuration-file rosetta_cli.json check:construction | |
| # shell: bash | |
| # - name: Run check:data test | |
| # run: | | |
| # ./bin/rosetta-cli --configuration-file rosetta_cli.json check:data | |
| # shell: bash | |
| # This is a no-op job that allows the resulting action names to line up when | |
| # there are no rust changes in a given PR/commit. This ensures that we can | |
| # continue to block on the rust tests passing in the case of rust changes and | |
| # otherwise not block pushes to main. | |
| # Note that this no-op job is only when there is a strategy matrix. | |
| # Other required jobs without strategy matrix do not need a no-op counterpart. | |
| test-notrust: | |
| name: test | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'false' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| - [ windows-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - run: 'echo "No build required" ' | |
| # This is a no-op job that allows the resulting action names to line up when | |
| # there are no rust changes in a given PR/commit. This ensures that we can | |
| # continue to block on the rust tests passing in the case of rust changes and | |
| # otherwise not block pushes to main. | |
| # Note that this no-op job is needed when there is a strategy matrix. | |
| # Other required jobs without strategy matrix do not need a no-op counterpart. | |
| test-extra-notrust: | |
| name: test-extra | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'false' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - [ ubuntu-ghcloud ] | |
| - [ windows-ghcloud ] | |
| fail-fast: false | |
| steps: | |
| - run: 'echo "No build required" ' | |
| clippy: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-ghcloud ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - run: rustup component add clippy | |
| # TODO(bradh): debug and re-enable this; the caching is breaking the clippy build | |
| # Enable caching of the 'librocksdb-sys' crate by additionally caching the | |
| # 'librocksdb-sys' src directory which is managed by cargo | |
| # - uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths | |
| # with: | |
| # path: ~/.cargo/registry/src/**/librocksdb-sys-* | |
| # See '[workspace.lints]' in the root Cargo.toml for the project-wide lint set | |
| - name: cargo clippy | |
| run: cargo xclippy -- -D warnings | |
| rustfmt: | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - run: rustup component add rustfmt | |
| - run: cargo fmt --check | |
| snapshot-check: | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - name: Check for committed *.snap.new files | |
| run: | | |
| # *.snap.new files are produced by insta when a snapshot test fails. | |
| # They must never be committed — review and accept them with `cargo insta review` instead. | |
| files=$(git ls-files '*.snap.new') | |
| if [ -n "$files" ]; then | |
| echo "Error: the following *.snap.new files are committed to the repo:" | |
| echo "$files" | |
| echo "Run 'cargo insta review' to accept or reject pending snapshots." | |
| exit 1 | |
| fi | |
| cargo-deny: | |
| name: cargo-deny (bans, licenses, sources) | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: taiki-e/install-action@cargo-deny | |
| - run: cargo deny check bans licenses sources --hide-inclusion-graph | |
| cargo-deny-advisories: | |
| name: cargo-deny (advisories) | |
| needs: diff | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-latest ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: taiki-e/install-action@cargo-deny | |
| - run: cargo deny check advisories --hide-inclusion-graph | |
| sui-excution-cut: | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token to assume the sccache role on trusted refs | |
| name: cutting a new execution layer | |
| needs: [diff, rustfmt, clippy, snapshot-check] | |
| if: needs.diff.outputs.isRust == 'true' | |
| runs-on: [ ubuntu-ghcloud ] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - uses: ./.github/actions/setup-sccache | |
| with: | |
| role-to-assume: ${{ env.SCCACHE_ROLE }} | |
| key-prefix: ubuntu-ghcloud | |
| - name: Install cargo-hakari, and cache the binary | |
| uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # pin@v3.0.0 | |
| with: | |
| crate: cargo-hakari | |
| locked: true | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ github.event.inputs.sui_repo_ref || github.ref }} | |
| - name: Make cut | |
| run: ./scripts/execution_layer.py cut for_ci_test | |
| - name: Check execution builds | |
| run: cargo build -p sui-execution |