diff --git a/.github/workflows/rust-version.yml b/.github/workflows/rust-version.yml deleted file mode 100644 index 4fc93c421..000000000 --- a/.github/workflows/rust-version.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Rust Version - -on: - workflow_dispatch: - schedule: - - cron: '0 13 * * *' - -jobs: - - set-rust-version: - uses: stellar/actions/.github/workflows/rust-set-rust-version.yml@main diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bc8fe0865..73c3b0d5d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -6,9 +6,6 @@ on: pull_request: merge_group: -env: - RUSTFLAGS: -D warnings - defaults: run: shell: bash @@ -64,6 +61,7 @@ jobs: strategy: fail-fast: false matrix: + rust: [msrv, latest] sys: - os: ubuntu-latest target: x86_64-unknown-linux-gnu @@ -85,15 +83,27 @@ jobs: steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main + - name: Use the minimum supported Rust version + if: matrix.rust == 'msrv' + run: | + msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')" + rustup override set $msrv + rustup component add clippy --toolchain $msrv + - name: Error on warnings and clippy checks + # Only error on warnings and checks for the msrv, because new versions of + # Rust will frequently add new warnings and checks. + if: matrix.rust == 'msrv' + run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV - run: rustup update + - run: cargo version - run: rustup target add ${{ matrix.sys.target }} - run: rustup target add wasm32-unknown-unknown - if: matrix.target == 'aarch64-unknown-linux-gnu' run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - uses: stellar/binaries@v12 + - uses: stellar/binaries@v18 with: name: cargo-hack - version: 0.5.16 + version: 0.5.28 - if: startsWith(matrix.sys.target, 'x86_64') name: Clear test snapshots for checking no diffs exists after test run run: rm -fr **/test_snapshots diff --git a/Cargo.toml b/Cargo.toml index 3d880d287..8939e667b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ members = [ [workspace.package] version = "20.1.0" +rust-version = "1.74.0" [workspace.dependencies] soroban-sdk = { version = "20.1.0", path = "soroban-sdk" } diff --git a/soroban-ledger-snapshot/Cargo.toml b/soroban-ledger-snapshot/Cargo.toml index c17a3c80b..514ecef69 100644 --- a/soroban-ledger-snapshot/Cargo.toml +++ b/soroban-ledger-snapshot/Cargo.toml @@ -8,7 +8,7 @@ readme = "../README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true [dependencies] soroban-env-host = { workspace = true } diff --git a/soroban-sdk-macros/Cargo.toml b/soroban-sdk-macros/Cargo.toml index 67d905dd5..c52205e91 100644 --- a/soroban-sdk-macros/Cargo.toml +++ b/soroban-sdk-macros/Cargo.toml @@ -8,7 +8,7 @@ readme = "../README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true [lib] proc-macro = true diff --git a/soroban-sdk/Cargo.toml b/soroban-sdk/Cargo.toml index a3f894055..987a66d41 100644 --- a/soroban-sdk/Cargo.toml +++ b/soroban-sdk/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true exclude = ["test_snapshots/", "src/tests/"] diff --git a/soroban-spec-rust/Cargo.toml b/soroban-spec-rust/Cargo.toml index 4a040d56c..0d367f25d 100644 --- a/soroban-spec-rust/Cargo.toml +++ b/soroban-spec-rust/Cargo.toml @@ -8,7 +8,7 @@ readme = "../README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true [dependencies] stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } diff --git a/soroban-spec/Cargo.toml b/soroban-spec/Cargo.toml index e3dcacd93..cea41cec1 100644 --- a/soroban-spec/Cargo.toml +++ b/soroban-spec/Cargo.toml @@ -8,7 +8,7 @@ readme = "../README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true [dependencies] stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } diff --git a/soroban-token-sdk/Cargo.toml b/soroban-token-sdk/Cargo.toml index ccb9294d1..ede024b14 100644 --- a/soroban-token-sdk/Cargo.toml +++ b/soroban-token-sdk/Cargo.toml @@ -8,7 +8,7 @@ readme = "../README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib", "rlib"] diff --git a/tests/add_i128/Cargo.toml b/tests/add_i128/Cargo.toml index 9f80c4470..87476bee7 100644 --- a/tests/add_i128/Cargo.toml +++ b/tests/add_i128/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/add_u128/Cargo.toml b/tests/add_u128/Cargo.toml index bedb2afa7..0015ef8f3 100644 --- a/tests/add_u128/Cargo.toml +++ b/tests/add_u128/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/add_u64/Cargo.toml b/tests/add_u64/Cargo.toml index 7865c5763..7e8f6f30f 100644 --- a/tests/add_u64/Cargo.toml +++ b/tests/add_u64/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/alloc/Cargo.toml b/tests/alloc/Cargo.toml index 435f138e4..e25629fe6 100644 --- a/tests/alloc/Cargo.toml +++ b/tests/alloc/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/auth/Cargo.toml b/tests/auth/Cargo.toml index 9a8387499..9b8b29272 100644 --- a/tests/auth/Cargo.toml +++ b/tests/auth/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/contract_data/Cargo.toml b/tests/contract_data/Cargo.toml index 8ce1e4199..ea1f51e5f 100644 --- a/tests/contract_data/Cargo.toml +++ b/tests/contract_data/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" -rust-version = "1.74" +rust-version.workspace = true publish = false [lib] diff --git a/tests/empty/Cargo.toml b/tests/empty/Cargo.toml index 981376e95..27375d1c3 100644 --- a/tests/empty/Cargo.toml +++ b/tests/empty/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/empty2/Cargo.toml b/tests/empty2/Cargo.toml index b8742b5e1..b106fbf12 100644 --- a/tests/empty2/Cargo.toml +++ b/tests/empty2/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/errors/Cargo.toml b/tests/errors/Cargo.toml index 63aac045c..26c360d35 100644 --- a/tests/errors/Cargo.toml +++ b/tests/errors/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/events/Cargo.toml b/tests/events/Cargo.toml index 2b7428e9d..a3da0215a 100644 --- a/tests/events/Cargo.toml +++ b/tests/events/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/fuzz/Cargo.toml b/tests/fuzz/Cargo.toml index 1f8bee461..bf7b00090 100644 --- a/tests/fuzz/Cargo.toml +++ b/tests/fuzz/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] # Adding rlib is required so that the test_fuzz crate can be imported as a diff --git a/tests/import_contract/Cargo.toml b/tests/import_contract/Cargo.toml index 3d4d7d661..8186c680c 100644 --- a/tests/import_contract/Cargo.toml +++ b/tests/import_contract/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/invoke_contract/Cargo.toml b/tests/invoke_contract/Cargo.toml index 7b9185bb3..33e45c116 100644 --- a/tests/invoke_contract/Cargo.toml +++ b/tests/invoke_contract/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/logging/Cargo.toml b/tests/logging/Cargo.toml index 93f622f9d..6f3c2a6ff 100644 --- a/tests/logging/Cargo.toml +++ b/tests/logging/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/multiimpl/Cargo.toml b/tests/multiimpl/Cargo.toml index 0b9da946c..1fb6c54fb 100644 --- a/tests/multiimpl/Cargo.toml +++ b/tests/multiimpl/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/udt/Cargo.toml b/tests/udt/Cargo.toml index 17bae6881..58522f1e0 100644 --- a/tests/udt/Cargo.toml +++ b/tests/udt/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/workspace_contract/Cargo.toml b/tests/workspace_contract/Cargo.toml index c1572b8c5..d9cbd13bb 100644 --- a/tests/workspace_contract/Cargo.toml +++ b/tests/workspace_contract/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/tests/workspace_lib/Cargo.toml b/tests/workspace_lib/Cargo.toml index 9a4f753d9..03f0fc7f1 100644 --- a/tests/workspace_lib/Cargo.toml +++ b/tests/workspace_lib/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.74" +rust-version.workspace = true [lib] crate-type = ["rlib"]