Skip to content

Commit

Permalink
check MSRV in CI
Browse files Browse the repository at this point in the history
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 helix-editor#1881.

This change adds a new CI check which uses the cargo-msrv crate to
verify an MSRV version recorded in helix-term's Cargo.toml. When
changing MSRV, we can then edit `helix-term/Cargo.toml`'s
`package.metadata.msrv` key.

The MSRV is set at 1.60.0 for the sake of checkmarks on builds but
ideally we want to support 1.57.0. The PR that fixes the MSRV in helix-editor#2460
should set this MSRV metadata key back to 1.57.0.

Closes helix-editor#2482.
  • Loading branch information
the-mikedavis committed May 22, 2022
1 parent 682bcc3 commit c2fae80
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
49 changes: 48 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
check:
name: Check
name: Check Stable
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -48,6 +48,53 @@ jobs:
with:
command: check

check-msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-v2-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-v2-cargo-index-

- name: Cache cargo target dir
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-v2-cargo-build-target-

- name: Install cargo-msrv
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-msrv

- name: Check MSRV compatibility
uses: actions-rs/cargo@v1
with:
command: msrv
args: --verify --path=helix-term

test:
name: Test Suite
runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions helix-term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repository = "https://github.com/helix-editor/helix"
homepage = "https://helix-editor.com"
include = ["src/**/*", "README.md"]
default-run = "hx"
metadata.msrv = "1.60.0"

[package.metadata.nix]
build = true
Expand Down

0 comments on commit c2fae80

Please sign in to comment.