Skip to content

Commit

Permalink
Run CI for the msrv and latest rust version (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Jan 11, 2024
1 parent 38883b4 commit 59d3d9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches: [main]
pull_request:

env:
RUSTFLAGS: -D warnings

jobs:

complete:
Expand Down Expand Up @@ -35,12 +32,27 @@ jobs:
run: rustup run nightly rust-analyzer analysis-stats . 2>&1 | (! grep ERROR)

build-and-test:
strategy:
matrix:
rust: [msrv, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- name: Use the minimum supported Rust version
if: matrix.rust == 'msrv'
run: |
msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
rustup override set $msrv
rustup component add clippy --toolchain $msrv
- name: Error on warnings and clippy checks
# Only error on warnings and checks for the msrv, because new versions of
# Rust will frequently add new warnings and checks.
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: rustup update
- run: cargo build
- run: cargo version
- run: cargo clippy
- run: cargo test

docs:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
license = "Apache-2.0"
version = "0.0.6"
edition = "2021"
rust-version = "1.66"
rust-version = "1.66.0"

[dependencies]
serde = "1.0.82"
Expand Down

0 comments on commit 59d3d9d

Please sign in to comment.