on master help sign in
check MSRV in CI

It's very easy to use new rust features without realizing it since the CI and local development workflows may use the latest rust version. We try to keep some backwards compatibility with rust versions to make packaging easier for some OS-level package-managers like Void Linux's. See #1881. This change runs the "Check" step for the pinned version of rust in the rust-toolchain.toml file as well as the MSRV version in a matrix. In order to bump the MSRV, we need to edit .github/workflows/msrv-rust-toolchain.toml This commit sets the MSRV as 1.60.0 but a later child commit will reduce the MSRV back to 1.57.0. Closes #2482.

commit92df5a542509e49a5ff71087b65fca2a17d5d25e authorMichael Davis <mcarsondavis@gmail.com> dateSat 21 May 2022, 21:27 (4 years ago) parentaa87adf
2 files changed+12−2
.github/workflows/build.yml+9−2 .github/workflows/msrv-rust-toolchain.toml+3
.github/workflows/build.yml+9−2
@@ -11,10 +11,17 @@ jobs:
1111 check:
1212 name: Check
1313 runs-on: ubuntu-latest
14+ strategy:
15+ matrix:
16+ rust: [stable, msrv]
1417 steps:
1518 - name: Checkout sources
1619 uses: actions/checkout@v3
1720
21+ - name: Use MSRV rust toolchain
22+ if: matrix.rust == 'msrv'
23+ run: cp .github/workflows/msrv-rust-toolchain.toml rust-toolchain.toml
24+
1825 - name: Install stable toolchain
1926 uses: helix-editor/rust-toolchain@v1
2027 with:
@@ -50,8 +57,8 @@ jobs:
5057 uses: actions/cache@v3
5158 with:
5259 path: runtime/grammars
53− key: ${{ runner.os }}-v2-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
54− restore-keys: ${{ runner.os }}-v2-tree-sitter-grammars-
60+ key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
61+ restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
5562
5663 - name: Run cargo test
5764 uses: actions-rs/cargo@v1
.github/workflows/msrv-rust-toolchain.tomlnew file+3
@@ -0,0 +1,3 @@
1+[toolchain]
2+channel = "1.60.0"
3+components = ["rustfmt", "rust-src"]