Skip to content

cargo update

cargo update #137

Workflow file for this run

name: Rust
on:
push:
branches: [ main ]
schedule:
- cron: 0 0 1 * *
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
- macos-11
rust:
- stable
- 1.46.0 # lib MSRV
- 1.60.0 # cli MSRV
include:
- os: ubuntu-latest
rust: stable
lint: 1
- rust: stable
rust-args: --all-features
- rust: 1.46.0
old-cargo-compat: 1
- rust: 1.60.0
rust-args: --all-features
exclude:
# rust < 1.54 does not work on macos >= 12:
# https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20How.20can.20I.20fix.20Rust.201.2E53.2E0.20or.20earlier.20to.20run.20on.20macOS.2012.2E6.3F/near/299263887
- os: macos-latest
rust: 1.46.0
- os: macos-11
rust: stable
- os: macos-11
rust: 1.60.0
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
override: true
- uses: Swatinem/rust-cache@v1
- name: Compatibility fixes for older versions of cargo
if: matrix.old-cargo-compat
run: |
# If we're testing with Rust < 1.60, cargo won't be able to find
# the clap version specified in Cargo.lock, so remove the lockfile.
# This is safe because applications that only use us as a library
# will also ignore our Cargo.lock.
# https://users.rust-lang.org/t/optional-dependencies-and-msrv/82151
cargo update -p clap --precise 3.2.25
# Downgrade the following crates because they require edition 2021
cargo update -p serde --precise 1.0.156
cargo update -p thiserror --precise 1.0.39
cargo update -p quote --precise 1.0.30
cargo update -p proc-macro2 --precise 1.0.65
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace ${{ matrix.rust-args }}
- name: rustfmt
if: github.event_name == 'pull_request' && matrix.lint
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: clippy
if: github.event_name == 'pull_request' && matrix.lint
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --tests --all-features -- -D warnings