From b41ad8cf86f685dc26ee8b72065546bbeabcf032 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 13:44:22 +0200 Subject: [PATCH 01/16] Add caching to CI jobs Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 49b33561..e1cbe3c8 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -18,6 +18,9 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: @@ -47,6 +50,9 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: @@ -101,6 +107,9 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: @@ -124,6 +133,9 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: From 41defb0ac1b548cb11160948ecf19ae94f559eb6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 13:55:12 +0200 Subject: [PATCH 02/16] Only run clippy with MSRV toolchain The comment says it all. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index e1cbe3c8..c15b40d5 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -101,8 +101,12 @@ jobs: strategy: matrix: rust: + # We run clippy only with our MSRV + # Running newer clippy (or even from the current stable channel) would + # randomly "break" our CI when the toolchain gets published in a new + # version. So there's no point in running it with two or more + # versions, MSRV should be fine. - 1.70.0 - - 1.73.0 steps: - name: Checkout sources uses: actions/checkout@v4.1.1 From 6be81bb0c797ea1ef45bffb9e999e09a941ec217 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 13:55:50 +0200 Subject: [PATCH 03/16] Only run checks on examples with one rust toolchain version There's no point in running it with two versions, and MSRV should suffice. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index c15b40d5..5031f224 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -131,7 +131,6 @@ jobs: matrix: rust: - 1.70.0 - - 1.73.0 steps: - name: Checkout sources From 4148198064f2e45d68736599d379fa6c1a818966 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 13:56:25 +0200 Subject: [PATCH 04/16] Remove clippy from cargo-check call for examples Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 5031f224..3022bf01 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -143,7 +143,6 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - components: clippy - name: Run cargo check run: cargo check --examples From 1a6c6fdc05a15e44d97f5f1ff87111355fc473da Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 13:57:39 +0200 Subject: [PATCH 05/16] Remove nightly from CI We do not get any benefit from running CI with the nightly toolchain. We still run it with beta, so that should catch some errors if there are any. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 3022bf01..465aa9a5 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -12,7 +12,6 @@ jobs: - 1.70.0 - stable - beta - - nightly steps: - name: Checkout sources @@ -27,12 +26,6 @@ jobs: toolchain: ${{ matrix.rust }} - name: Run cargo check - if: matrix.rust != 'nightly' - run: cargo check --all-features - - - name: Run cargo check (nightly) - if: matrix.rust == 'nightly' - continue-on-error: true run: cargo check --all-features test: @@ -45,7 +38,6 @@ jobs: - 1.70.0 - stable - beta - - nightly steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -59,17 +51,6 @@ jobs: toolchain: ${{ matrix.rust }} - name: Run cargo test - if: matrix.rust != 'nightly' && matrix.rust != '1.56.1' - run: cargo test --all-features - - - name: Run cargo test (nightly) - if: matrix.rust == '1.66.0' - continue-on-error: true - run: cargo test --tests --all-features - - - name: Run cargo test (nightly) - if: matrix.rust == 'nightly' - continue-on-error: true run: cargo test --all-features fmt: From a9a48526d8f7270f2daaba6bf2abe41e0a34c68d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:01:36 +0200 Subject: [PATCH 06/16] Run rustfmt with MSRV toolchain Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 465aa9a5..b4956f28 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -60,7 +60,7 @@ jobs: strategy: matrix: rust: - - stable + - 1.70.0 - beta steps: - name: Checkout sources From 47af0957eca221989859dabd972e302c92dd48e5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:01:50 +0200 Subject: [PATCH 07/16] Do not depend on changing toolchain version If stable updates and introduces a new lint for example, that could break our CI "randomly". Thus, we do no longer depend on a mutable version of the toolchain, but on a fixed one (that now has to be updated regularly, of course). Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index b4956f28..fcbe1222 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -10,7 +10,7 @@ jobs: matrix: rust: - 1.70.0 - - stable + - 1.73.0 # stable - beta steps: @@ -36,7 +36,7 @@ jobs: matrix: rust: - 1.70.0 - - stable + - 1.73.0 # stable - beta steps: - name: Checkout sources From 0e2c8668e2872269902672df80048209d817aa0b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:03:23 +0200 Subject: [PATCH 08/16] Do not allow changing rust toolchain breaking our CI Same as with the mutable "stable" being removed from our CI, we run beta toolchain CI stuff, but we should no longer allow a changing beta version break our CI "randomly". Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index fcbe1222..1df22cbc 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -26,6 +26,7 @@ jobs: toolchain: ${{ matrix.rust }} - name: Run cargo check + continue-on-error: ${{ matrix.rust == 'beta' }} run: cargo check --all-features test: @@ -51,6 +52,7 @@ jobs: toolchain: ${{ matrix.rust }} - name: Run cargo test + continue-on-error: ${{ matrix.rust == 'beta' }} run: cargo test --all-features fmt: @@ -73,6 +75,7 @@ jobs: components: rustfmt - name: Run cargo fmt + continue-on-error: ${{ matrix.rust == 'beta' }} run: cargo fmt --all -- --check clippy: From e695826e7ca890824390728b68e5581921ac9e0d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:15:05 +0200 Subject: [PATCH 09/16] Remove dedicated example checking, non-MSRV checking This is another attempt at increasing the CI speed. It does so by removin the dedicated example checking phase, by putting all checks in one phase (examples, tests) and run that phase only for MSRV. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 1df22cbc..52d3854c 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -10,8 +10,6 @@ jobs: matrix: rust: - 1.70.0 - - 1.73.0 # stable - - beta steps: - name: Checkout sources @@ -26,8 +24,7 @@ jobs: toolchain: ${{ matrix.rust }} - name: Run cargo check - continue-on-error: ${{ matrix.rust == 'beta' }} - run: cargo check --all-features + run: cargo check --all-features --examples --tests test: needs: [check] @@ -63,7 +60,6 @@ jobs: matrix: rust: - 1.70.0 - - beta steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -107,27 +103,3 @@ jobs: - name: Run cargo clippy run: cargo clippy --all-targets --all-features -- -D warnings - check-examples: - name: Check examples - needs: [check] - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.70.0 - - steps: - - name: Checkout sources - uses: actions/checkout@v4.1.1 - - - name: Cache - uses: Swatinem/rust-cache@v2 - - - name: Install toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - - name: Run cargo check - run: cargo check --examples - From 5c4d4e98e37cd65d5e27f298d87cda981789be26 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:29:35 +0200 Subject: [PATCH 10/16] Use nextest as test runner Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 52d3854c..9e3ec63c 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -43,14 +43,17 @@ jobs: - name: Cache uses: Swatinem/rust-cache@v2 + - name: Install nextest + uses: taiki-e/install-action@nextest + - name: Install toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - - name: Run cargo test + - name: Run cargo nextest continue-on-error: ${{ matrix.rust == 'beta' }} - run: cargo test --all-features + run: cargo nextest run --all-features fmt: needs: [check] From 5943e2afc2d05be74c9ab3333d6c4145b6c80bf3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Oct 2023 14:30:40 +0200 Subject: [PATCH 11/16] Do not depend on "check" phase for tests The test phase is the slowest, because it actually produces binaries for running tests. So do not depend on the "check" phase, so that the test phase starts as soon as possible, to speed up overall CI time. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 9e3ec63c..4d858b03 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -27,7 +27,6 @@ jobs: run: cargo check --all-features --examples --tests test: - needs: [check] name: Test Suite runs-on: ubuntu-latest strategy: From 24e1e3ce8ccb1fdd646848c88803ffd188bb0576 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 31 Oct 2023 09:11:51 +0100 Subject: [PATCH 12/16] Move cache job after toolchain installation Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 4d858b03..859d953d 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -15,14 +15,14 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - name: Cache - uses: Swatinem/rust-cache@v2 - - name: Install toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Run cargo check run: cargo check --all-features --examples --tests @@ -39,9 +39,6 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - name: Cache - uses: Swatinem/rust-cache@v2 - - name: Install nextest uses: taiki-e/install-action@nextest @@ -50,6 +47,9 @@ jobs: with: toolchain: ${{ matrix.rust }} + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Run cargo nextest continue-on-error: ${{ matrix.rust == 'beta' }} run: cargo nextest run --all-features @@ -93,15 +93,15 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - name: Cache - uses: Swatinem/rust-cache@v2 - - name: Install toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} components: clippy + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Run cargo clippy run: cargo clippy --all-targets --all-features -- -D warnings From 20f0774e39fff9ee78ab901f68678583bba49f46 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 31 Oct 2023 09:13:59 +0100 Subject: [PATCH 13/16] Revert "Use nextest as test runner" The nextest runner does not help enough to be viable. Installing it takes more time than the runner saves, so go back to the normal test runner with this patch. This reverts commit 284de85f4e16f28caece29ae7ae3aa41b48afa54. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 859d953d..131ba504 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -39,9 +39,6 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - name: Install nextest - uses: taiki-e/install-action@nextest - - name: Install toolchain uses: dtolnay/rust-toolchain@master with: @@ -50,9 +47,9 @@ jobs: - name: Cache uses: Swatinem/rust-cache@v2 - - name: Run cargo nextest + - name: Run cargo test continue-on-error: ${{ matrix.rust == 'beta' }} - run: cargo nextest run --all-features + run: cargo test --all-features fmt: needs: [check] From abbd836f293b451a722a60d928169205c635e60c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 31 Oct 2023 09:15:35 +0100 Subject: [PATCH 14/16] Run tests only with current stable toolchain This saves a bit of execution time. There's no point in running MSRV and stable, because there shouldn't be a difference. So we opt for stable because it tends to be faster. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 131ba504..336bde08 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -29,12 +29,6 @@ jobs: test: name: Test Suite runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.70.0 - - 1.73.0 # stable - - beta steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -42,13 +36,12 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: 1.73.0 - name: Cache uses: Swatinem/rust-cache@v2 - name: Run cargo test - continue-on-error: ${{ matrix.rust == 'beta' }} run: cargo test --all-features fmt: From 40ede3d24bee6ba1683dbe751e1b61b2b4f51ea0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 1 Feb 2024 07:48:45 +0100 Subject: [PATCH 15/16] Remove matrix builds Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 336bde08..ca13beb8 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -6,11 +6,6 @@ jobs: check: name: Check runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.70.0 - steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -18,7 +13,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: 1.70.0 - name: Cache uses: Swatinem/rust-cache@v2 @@ -48,10 +43,6 @@ jobs: needs: [check] name: Rustfmt runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.70.0 steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -59,7 +50,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: 1.70.0 components: rustfmt - name: Run cargo fmt @@ -70,15 +61,6 @@ jobs: needs: [check] name: Clippy runs-on: ubuntu-latest - strategy: - matrix: - rust: - # We run clippy only with our MSRV - # Running newer clippy (or even from the current stable channel) would - # randomly "break" our CI when the toolchain gets published in a new - # version. So there's no point in running it with two or more - # versions, MSRV should be fine. - - 1.70.0 steps: - name: Checkout sources uses: actions/checkout@v4.1.1 @@ -86,7 +68,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: 1.70.0 components: clippy - name: Cache From ccb305a57562d8f1124f8d05f02149b7906453d2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 1 Feb 2024 07:49:05 +0100 Subject: [PATCH 16/16] Execute tests on same toolchain as builds Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index ca13beb8..723c1cef 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -31,7 +31,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: 1.73.0 + toolchain: 1.70.0 - name: Cache uses: Swatinem/rust-cache@v2