Merge pull request #596 from andrey-yantsen/dependabot/github_actions… #745
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
--- | |
"on": | |
push: | |
branches: [main, staging, trying] | |
pull_request: | |
branches: [main] | |
name: Lints | |
jobs: | |
msrv: | |
name: MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Get current MSRV from crates/plex-api/Cargo.toml | |
id: current_msrv | |
run: | | |
msrv=$(cat crates/plex-api/Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//') | |
echo "msrv=$msrv" >> $GITHUB_OUTPUT | |
- name: Install the toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{steps.current_msrv.outputs.msrv}} | |
- uses: Swatinem/rust-cache@v2.7.1 | |
with: | |
shared-key: cache | |
- name: Check | |
run: cargo check --workspace --all-targets | |
- name: Check the new MSRV | |
if: ${{ failure() }} | |
run: | | |
cargo install cargo-msrv | |
cargo msrv --bisect --min ${{steps.current_msrv.outputs.msrv}} | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2.7.1 | |
with: | |
shared-key: cache | |
- name: Run cargo check | |
run: cargo check | |
lints: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: "rustfmt,clippy" | |
- uses: Swatinem/rust-cache@v2.7.1 | |
with: | |
shared-key: cache | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Clippy with warnings | |
run: cargo clippy --all-targets --all-features -- -D warnings |