cargo update #134
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
no-lock: 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 | |
# 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 | |
- name: Compatibility fixes for older versions of cargo | |
if: matrix.no-lock | |
run: | | |
cargo update -p serde --precise 1.0.156 | |
cargo update -p clap --precise 3.2.25 | |
cargo update -p thiserror --precise 1.0.38 | |
- 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 |