Skip to content

Commit

Permalink
Build and test the MSRV and latest
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Jan 10, 2024
1 parent 81a535e commit d67d9a2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches: [main]
pull_request:

env:
RUSTFLAGS: -Wclippy::all -Wclippy::pedantic

jobs:

# complete:
Expand All @@ -28,6 +25,7 @@ jobs:
build-and-test:
strategy:
matrix:
rust: [msrv, latest]
sys:
- os: ubuntu-latest
target: wasm32-unknown-unknown
Expand All @@ -39,7 +37,19 @@ 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 -Wclippy::all -Wclippy::pedantic' >> $GITHUB_ENV
- run: rustup update
- run: cargo version
- run: rustup target add ${{ matrix.sys.target }}
- run: cargo clippy --target ${{ matrix.sys.target }} --lib
- if: matrix.sys.target != 'wasm32-unknown-unknown'
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ members = [
"contracts/*",
]

[workspace.package]
rust-version = "1.74.0"

[profile.release]
opt-level = "z"
overflow-checks = true
Expand Down
1 change: 1 addition & 0 deletions contracts/abundance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "abundance-token"
description = "Soroban standard token contract, but anyone can mint to themselves."
version = "0.0.6"
edition = "2021"
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions contracts/crowdfund/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "soroban-crowdfund-contract"
version = "0.0.0"
edition = "2021"
rust-version.workspace = true
publish = false
autobins = false

Expand Down

0 comments on commit d67d9a2

Please sign in to comment.