Skip to content

Commit d46fcf5

Browse files
authored
Only run cargo check for MSRV (#296)
It should be enough to verify that the code compiles, we're testing it elsewhere, and we don't need development dependencies to follow MSRV.
1 parent 81904ea commit d46fcf5

File tree

1 file changed

+59
-26
lines changed

1 file changed

+59
-26
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,71 @@ jobs:
2525
- name: Run Typos
2626
run: typos
2727

28+
msrv:
29+
name: MSRV
30+
needs: fmt
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
# Android
37+
- target: aarch64-linux-android
38+
39+
# CoreGraphics
40+
- target: aarch64-apple-darwin
41+
- target: x86_64-apple-ios
42+
43+
# Orbital (doesn't follow MSRV)
44+
# - target: x86_64-unknown-redox
45+
46+
# Wayland, KMS/DRM, X11
47+
- target: i686-unknown-linux-gnu
48+
- target: x86_64-unknown-linux-gnu
49+
- target: x86_64-unknown-linux-gnu
50+
features: "x11,x11-dlopen"
51+
- target: x86_64-unknown-linux-gnu
52+
features: "wayland,wayland-dlopen"
53+
- target: x86_64-unknown-linux-gnu
54+
features: "kms"
55+
- target: x86_64-unknown-freebsd
56+
- target: x86_64-unknown-netbsd
57+
features: "x11,x11-dlopen,wayland,wayland-dlopen"
58+
59+
# Web
60+
- target: wasm32-unknown-unknown
61+
62+
# Win32
63+
- target: x86_64-pc-windows-msvc
64+
- target: x86_64-pc-windows-gnu
65+
66+
steps:
67+
- uses: actions/checkout@v6
68+
- uses: hecrj/setup-rust-action@v2
69+
with:
70+
rust-version: '1.71.1'
71+
targets: ${{ matrix.target }}
72+
73+
- name: Use minimal dependency versions
74+
# By downgrading all our dependency versions, we ensure that our minimum
75+
# version bounds are actually adequate (i.e. users can build `softbuffer`
76+
# with minimal versions themselves) and opt-out of any unexpected MSRV
77+
# bumps in semver-compatible releases of downstream crates.
78+
#
79+
# RUSTC_BOOTSTRAP=1 is kind of a hack, but it's cumbersome and slow to
80+
# install the nightly toolchain.
81+
run: RUSTC_BOOTSTRAP=1 cargo -Zminimal-versions generate-lockfile
82+
83+
- name: Check that crate compiles
84+
run: cargo check --verbose --target ${{ matrix.target }} ${{ matrix.features && '--no-default-features --features' }} ${{ matrix.features }}
85+
2886
tests:
2987
name: Tests
3088
needs: fmt
3189
strategy:
3290
fail-fast: false
3391
matrix:
34-
rust_version: ['1.71.0', stable, nightly]
92+
rust_version: [stable, nightly]
3593
platform:
3694
- { target: x86_64-pc-windows-msvc, os: windows-latest, }
3795
- { target: i686-pc-windows-msvc, os: windows-latest, }
@@ -49,10 +107,6 @@ jobs:
49107
- { target: x86_64-unknown-netbsd, os: ubuntu-latest, options: --no-default-features, features: "x11,x11-dlopen,wayland,wayland-dlopen" }
50108
- { target: aarch64-apple-darwin, os: macos-latest, }
51109
- { target: wasm32-unknown-unknown, os: ubuntu-latest, }
52-
exclude:
53-
# Orbital doesn't follow MSRV
54-
- rust_version: '1.71.0'
55-
platform: { target: x86_64-unknown-redox, os: ubuntu-latest }
56110
include:
57111
- rust_version: nightly
58112
platform: { target: wasm32-unknown-unknown, os: ubuntu-latest, options: "-Zbuild-std=panic_abort,std", rustflags: "-Ctarget-feature=+atomics,+bulk-memory" }
@@ -81,27 +135,6 @@ jobs:
81135
with:
82136
tool: wasm-bindgen-cli
83137

84-
- name: Install nightly rust to generate `-Zminimal-versions` lockfile (for MSRV)
85-
if: matrix.rust_version == '1.71.0'
86-
uses: dtolnay/rust-toolchain@nightly
87-
88-
- name: Pin deps that break MSRV
89-
if: matrix.rust_version == '1.71.0'
90-
# By downgrading all our dependency versions, we ensure that our minimum
91-
# version bounds are actually adequate (i.e. users can build `softbuffer`
92-
# with minimal versions themselves) and opt-out of any unexpected MSRV
93-
# bumps in semver-compatible releases of downstream crates.
94-
run: |
95-
cargo -Zminimal-versions generate-lockfile
96-
# Bump `regex` - only used by our `dev-dependencies` `criterion` dependency - to fix:
97-
# https://github.com/rust-lang/regex/issues/931
98-
# Can be removed on the next `criterion` upgrade: https://github.com/bheisler/criterion.rs/pull/821
99-
cargo update -p regex --precise 1.5.1
100-
cargo update -p num-traits --precise 0.2.16 # Unconditional i128 support used by image
101-
cargo update -p anyhow --precise 1.0.19 # walrus needs bail!() string support from 1.0.1, wasm-bindgen-cli-support requires format_err from 1.0.19
102-
cargo update -p foreign-types-macros --precise 0.2.2 # `core-graphics 0.23.1` from `winit 0.30` fails to compile on 0.2.1
103-
cargo update -p same-file --precise 1.0.5 # First release with `unknown` support for wasm32
104-
105138
- uses: hecrj/setup-rust-action@v2
106139
with:
107140
rust-version: ${{ matrix.rust_version }}${{ matrix.platform.host }}

0 commit comments

Comments
 (0)