Skip to content

Commit

Permalink
Run CI for the msrv and latest rust version (#1205)
Browse files Browse the repository at this point in the history
### What
Build and test the MSRV and latest

### Why
For stellar/rs-soroban-env#1311
  • Loading branch information
leighmcculloch authored Jan 10, 2024
1 parent 811ce3d commit 9f955ef
Show file tree
Hide file tree
Showing 27 changed files with 40 additions and 40 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/rust-version.yml

This file was deleted.

20 changes: 15 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
pull_request:
merge_group:

env:
RUSTFLAGS: -D warnings

defaults:
run:
shell: bash
Expand Down Expand Up @@ -64,6 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion soroban-ledger-snapshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]

Expand Down
2 changes: 1 addition & 1 deletion soroban-spec-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion soroban-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion soroban-token-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion tests/add_i128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/add_u128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/add_u64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/contract_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.74"
rust-version.workspace = true
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion tests/empty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/empty2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
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
Expand Down
2 changes: 1 addition & 1 deletion tests/import_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/invoke_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/multiimpl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/udt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/workspace_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/workspace_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
rust-version = "1.74"
rust-version.workspace = true

[lib]
crate-type = ["rlib"]
Expand Down

0 comments on commit 9f955ef

Please sign in to comment.