Skip to content

Commit

Permalink
Merge pull request #518 from mgeisler/build-with-msrv
Browse files Browse the repository at this point in the history
Test with stable and nightly, build with 1.56
  • Loading branch information
mgeisler committed Sep 23, 2023
2 parents 2f74140 + 8cdc055 commit 1136d3e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -16,20 +16,21 @@ env:

jobs:

# Here we check that we can run `cargo test` on modern versions of
# Rust. Below we check that we can build the library on an old
# version as well.
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- '1.60' # Current MSRV
- stable
- nightly
features:
- no default features
- all features
- default features

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -61,6 +62,34 @@ jobs:
- name: Test with default features
run: cargo test

msrv:
name: Minimum supported Rust version
runs-on: ubuntu-latest
strategy:
matrix:
features:
- no default features
- all features
- default features
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust 1.56 # MSRV from Cargo.toml
run: rustup default 1.56

- uses: Swatinem/rust-cache@v2

- name: Build with ${{ matrix.features }}
run: |
FLAG="${{ matrix.features }}"
if [[ "$FLAG" = "default features" ]]; then
FLAG='' # Needs no flag
else
FLAG="--${FLAG// /-}" # Turn 'foo bar' into '--foo-bar'
fi
cargo build $FLAG
# This builds benchmarks, which are not covered above.
build-benchmarks:
name: Build benchmarks
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -10,7 +10,7 @@ keywords = ["text", "formatting", "wrap", "typesetting", "hyphenation"]
categories = ["text-processing", "command-line-interface"]
license = "MIT"
edition = "2021"
rust-version = "1.60"
rust-version = "1.56"
exclude = [".github/", ".gitignore", "benchmarks/", "examples/", "fuzz/", "images/"]

[[example]]
Expand Down

0 comments on commit 1136d3e

Please sign in to comment.