Skip to content

Commit a96e69f

Browse files
committed
CI Read rust-version from Cargo.toml
1 parent 7c107c2 commit a96e69f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ on:
1515

1616
env:
1717
CARGO_TERM_COLOR: always
18-
# When updating this, also update:
19-
# - src/lib.rs
20-
# - Cargo.toml
21-
# - README.md
22-
rust_minver: 1.66.1
2318
ci_targets: "['x86_64-unknown-linux-gnu', 'x86_64-pc-windows-msvc', 'aarch64-apple-darwin', 'x86_64-apple-ios', 'x86_64-unknown-freebsd', 'x86_64-unknown-illumos', 'aarch64-linux-android']"
2419

2520
defaults:
@@ -208,12 +203,17 @@ jobs:
208203
run: sudo bash ./.github/workflows/install-deps.sh
209204
- name: Install Rust nightly
210205
run: rustup toolchain install nightly
211-
- name: Install Rust ${{ env.rust_minver }}
212-
run: rustup toolchain install ${{ env.rust_minver }}
206+
- name: Read rust-version from Cargo.toml
207+
run: |
208+
MSRV=$(yq '.workspace.package.rust-version' ./Cargo.toml)
209+
echo $MSRV
210+
echo "MSRV=$MSRV" >> $GITHUB_ENV
211+
- name: Install Rust ${{ env.MSRV }}
212+
run: rustup toolchain install ${{ env.MSRV }}
213213
- name: Install Rust target
214214
run: |
215215
rustup target add ${{ matrix.target }} --toolchain nightly
216-
rustup target add ${{ matrix.target }} --toolchain ${{ env.rust_minver }}
216+
rustup target add ${{ matrix.target }} --toolchain ${{ env.MSRV }}
217217
echo 'CARGO_BUILD_TARGET=${{ matrix.target }}' >> $GITHUB_ENV
218218
- name: Restore cargo caches
219219
uses: Swatinem/rust-cache@v2
@@ -224,8 +224,8 @@ jobs:
224224
perl -pi -e 's/\[dev-dependencies]/[workaround-avoid-dev-deps]/g' ./spdlog/Cargo.toml
225225
- name: Downgrade dependencies to minimal versions
226226
run: cargo +nightly update -Z minimal-versions
227-
- name: Check MSRV for core with Rust ${{ env.rust_minver }}
228-
run: cargo +${{ env.rust_minver }} check --locked --all-features --verbose
227+
- name: Check MSRV for core with Rust ${{ env.MSRV }}
228+
run: cargo +${{ env.MSRV }} check --locked --all-features --verbose
229229

230230
test-native-linux:
231231
strategy:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88

99
[workspace.package]
1010
edition = "2021"
11-
rust-version = "1.66.1"
11+
rust-version = "1.66.1" # When updating this, also update: src/lib.rs, README.md
1212
repository = "https://github.com/SpriteOvO/spdlog-rs"
1313
license = "MIT OR Apache-2.0"
1414
keywords = ["spdlog", "log", "logging"]

0 commit comments

Comments
 (0)