Skip to content

Commit ee6c45e

Browse files
authoredMar 16, 2025··
Tries to stabilize MSRV CI/CD. (#1485)
* Tries to stabilize MSRV CI/CD. With the new MSRV-aware resolver available, I am trying to stabilize our CI/CD, which frequently breaks due to dependency updates. This takes three steps to do so: 1. Add Cargo.lock, so that builds on the CI/CD are deterministic 2. Add a regular (weekly) job that checks against the latest dependencies across both stable and MSRV versions of rustc 3. Simplify the current CI/CD and revert to a single MSRV, rather than using a BLAS-specific MSRV.
1 parent 41bace1 commit ee6c45e

File tree

6 files changed

+1405
-7
lines changed

6 files changed

+1405
-7
lines changed
 

‎.github/workflows/ci.yaml

+17-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ env:
1616
BLAS_MSRV: 1.71.1
1717

1818
jobs:
19+
pass-msrv:
20+
runs-on: ubuntu-latest
21+
name: Pass MSRV values to other jobs
22+
outputs:
23+
MSRV: ${{ env.MSRV }}
24+
BLAS_MSRV: ${{ env.BLAS_MSRV }}
25+
steps:
26+
- name: Pass MSRV
27+
run: |
28+
echo "MSRV=${{ env.MSRV }}" >> $GITHUB_OUTPUT
29+
echo "BLAS_MSRV=${{ env.BLAS_MSRV }}" >> $GITHUB_OUTPUT
30+
1931
clippy:
2032
runs-on: ubuntu-latest
2133
strategy:
@@ -70,13 +82,14 @@ jobs:
7082
7183
tests:
7284
runs-on: ubuntu-latest
85+
needs: pass-msrv
7386
strategy:
7487
matrix:
7588
rust:
7689
- stable
7790
- beta
7891
- nightly
79-
- 1.64.0 # MSRV
92+
- ${{ needs.pass-msrv.outputs.MSRV }}
8093

8194
name: tests/${{ matrix.rust }}
8295
steps:
@@ -89,15 +102,16 @@ jobs:
89102
- name: Install openblas
90103
run: sudo apt-get install libopenblas-dev gfortran
91104
- run: ./scripts/all-tests.sh "$FEATURES" ${{ matrix.rust }}
92-
105+
93106
blas-msrv:
94107
runs-on: ubuntu-latest
95108
name: blas-msrv
109+
needs: pass-msrv
96110
steps:
97111
- uses: actions/checkout@v4
98112
- uses: dtolnay/rust-toolchain@master
99113
with:
100-
toolchain: 1.71.1 # BLAS MSRV
114+
toolchain: ${{ needs.pass-msrv.outputs.BLAS_MSRV }}
101115
- uses: rui314/setup-mold@v1
102116
- uses: Swatinem/rust-cache@v2
103117
- name: Install openblas

‎.github/workflows/latest-deps.yaml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Check Latest Dependencies
2+
on:
3+
schedule:
4+
# Chosen so that it runs right before the international date line experiences the weekend.
5+
# Since we're open source, that means globally we should be aware of it right when we have the most
6+
# time to fix it.
7+
#
8+
# Sorry if this ruins your weekend, future maintainer...
9+
- cron: '0 12 * * FRI'
10+
workflow_dispatch: # For running manually
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
HOST: x86_64-unknown-linux-gnu
15+
FEATURES: "approx,serde,rayon"
16+
RUSTFLAGS: "-D warnings"
17+
MSRV: 1.64.0
18+
BLAS_MSRV: 1.71.0
19+
20+
jobs:
21+
latest_deps_stable:
22+
runs-on: ubuntu-latest
23+
name: Check Latest Dependencies on Stable
24+
steps:
25+
- name: Check Out Repo
26+
uses: actions/checkout@v4
27+
- name: Install Rust
28+
uses: dtolnay/rust-toolchain@master
29+
with:
30+
toolchain: stable
31+
- name: Setup Mold Linker
32+
uses: rui314/setup-mold@v1
33+
- name: Setup Rust Cache
34+
uses: Swatinem/rust-cache@v2
35+
- name: Install openblas
36+
run: sudo apt-get install libopenblas-dev gfortran
37+
- name: Ensure latest dependencies
38+
run: cargo update
39+
- name: Run Tests
40+
run: ./scripts/all-tests.sh "$FEATURES" stable
41+
42+
latest_deps_msrv:
43+
runs-on: ubuntu-latest
44+
name: Check Latest Dependencies on MSRV (${{ env.MSRV }})
45+
steps:
46+
- name: Check Out Repo
47+
uses: actions/checkout@v4
48+
- name: Install Stable Rust for Update
49+
uses: dtolnay/rust-toolchain@master
50+
with:
51+
toolchain: stable
52+
- name: Setup Mold Linker
53+
uses: rui314/setup-mold@v1
54+
- name: Setup Rust Cache
55+
uses: Swatinem/rust-cache@v2
56+
- name: Install openblas
57+
run: sudo apt-get install libopenblas-dev gfortran
58+
- name: Ensure latest dependencies
59+
# The difference is here between this and `latest_deps_stable`
60+
run: CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS="fallback" cargo update
61+
- name: Install MSRV Rust for Test
62+
uses: dtolnay/rust-toolchain@master
63+
with:
64+
toolchain: ${{ env.MSRV }}
65+
- name: Run Tests
66+
run: ./scripts/all-tests.sh "$FEATURES" $MSRV

‎.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Rust items
2-
Cargo.lock
32
target/
43

54
# Editor settings

‎Cargo.lock

+1,321
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/all-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cargo test -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FE
2323
# BLAS tests
2424
cargo test -p ndarray --lib -v --features blas
2525
cargo test -p blas-mock-tests -v
26-
if [ "$CHANNEL" != "1.64.0" ]; then
26+
if [[ -z "${MSRV}" ]] && [ "$CHANNEL" != "$MSRV" ]; then
2727
./scripts/blas-integ-tests.sh "$FEATURES" $CHANNEL
2828
fi
2929

‎scripts/blas-integ-tests.sh

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
set -x
44
set -e
55

6-
CHANNEL=$1
7-
86
# BLAS tests
97
cargo test -p blas-tests -v --features blas-tests/openblas-system
108
cargo test -p numeric-tests -v --features numeric-tests/test_blas

0 commit comments

Comments
 (0)
Please sign in to comment.