From ba2cd0ff8019585a8f9e9d2bdadcd2205e4454c8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:06:53 +1100 Subject: [PATCH 1/8] Fix msrv CI: Check for `--all-features` and macos To make sure that enabling `parallel` feature would not require bumping msrv. Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f85288d4d..deac928b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,7 +115,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] + feature: ["", "--all-features"] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -123,7 +124,7 @@ jobs: rustup toolchain install 1.46.0 --no-self-update --profile minimal rustup default 1.46.0 shell: bash - - run: cargo check --lib + - run: cargo check --lib ${{ matrix.feature }} rustfmt: name: Rustfmt From 59a590fe1caa6b89c3657dcb746ab4b089f3a7c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:14:10 +1100 Subject: [PATCH 2/8] Use minimal-versions and fetch deps crates using stable Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index deac928b0..4084656ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -122,8 +122,13 @@ jobs: - name: Install Rust run: | rustup toolchain install 1.46.0 --no-self-update --profile minimal + rustup toolchain install nightly --no-self-update --profile minimal rustup default 1.46.0 shell: bash + - name: Create Cargo.lock with minimal version + run: cargo +nightly update -Zminimal-versions + - name: Fetch dependencies crates using stable since fetching them using 1.46.0 is very slow + run: cargo +stable fetch - run: cargo check --lib ${{ matrix.feature }} rustfmt: From e00afc84dcd5029c89f188cf10fa51625a707a76 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:18:02 +1100 Subject: [PATCH 3/8] Fix fetching deps in msrv Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4084656ed..fa214b425 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,7 +128,7 @@ jobs: - name: Create Cargo.lock with minimal version run: cargo +nightly update -Zminimal-versions - name: Fetch dependencies crates using stable since fetching them using 1.46.0 is very slow - run: cargo +stable fetch + run: cargo +stable check - run: cargo check --lib ${{ matrix.feature }} rustfmt: From 54630e0a077ab9d2cb45e0aee7fad3b8f98351a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:19:40 +1100 Subject: [PATCH 4/8] Cache downlaoded crates since 1.46 is really slow in fetching Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa214b425..686ea8baa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,8 +127,8 @@ jobs: shell: bash - name: Create Cargo.lock with minimal version run: cargo +nightly update -Zminimal-versions - - name: Fetch dependencies crates using stable since fetching them using 1.46.0 is very slow - run: cargo +stable check + - name: Cache downloaded crates since 1.46 is really slow in fetching + uses: Swatinem/rust-cache@v2 - run: cargo check --lib ${{ matrix.feature }} rustfmt: From 7a359016a5c7f233626256a9f3106439749a3d32 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:21:53 +1100 Subject: [PATCH 5/8] Skip msrv for macos-latest since newer xcode breaks 1.46 linking Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 686ea8baa..e770f577c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,7 +115,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, windows-latest] feature: ["", "--all-features"] steps: - uses: actions/checkout@v3 From e1a3f582a1164bb474eb4b7de38581bc63d7c655 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:23:21 +1100 Subject: [PATCH 6/8] CI: Disable fail-fast for msrv check Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e770f577c..aba956f43 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -114,6 +114,7 @@ jobs: name: MSRV runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] feature: ["", "--all-features"] From ab2db8e81ff35694525203655d07ccbe292e77f3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:28:51 +1100 Subject: [PATCH 7/8] CI: Add feature to cache key of msrv Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aba956f43..6139cf184 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,6 +130,8 @@ jobs: run: cargo +nightly update -Zminimal-versions - name: Cache downloaded crates since 1.46 is really slow in fetching uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.feature }} - run: cargo check --lib ${{ matrix.feature }} rustfmt: From cac78937f7ce6e8e86c94ef27786165c28234919 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 28 Oct 2023 00:37:17 +1100 Subject: [PATCH 8/8] CI: Rm matrix features of msrv Since most of the time is spent on installing Rust, there's no point in parallelizing it. Signed-off-by: Jiahao XU --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6139cf184..dcdc74725 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,7 +117,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - feature: ["", "--all-features"] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -130,9 +129,8 @@ jobs: run: cargo +nightly update -Zminimal-versions - name: Cache downloaded crates since 1.46 is really slow in fetching uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.feature }} - - run: cargo check --lib ${{ matrix.feature }} + - run: cargo check --lib + - run: cargo check --lib --all-features rustfmt: name: Rustfmt