code-quality #63
This file contains hidden or 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: code-quality | |
"on": | |
push: | |
branches: [dev, master] | |
paths-ignore: | |
- "**.md" | |
- "docs/**" | |
- "contrib/**" | |
- "LICENSE" | |
- "*.sh" | |
- "**/Dockerfile*" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
- "docs/**" | |
- "contrib/**" | |
- "LICENSE" | |
- "*.sh" | |
- "**/Dockerfile*" | |
schedule: | |
# Run CI every week | |
- cron: "00 01 * * 0" | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: -D warnings | |
jobs: | |
fmt: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
clippy: | |
needs: fmt | |
name: cargo clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install developer package dependencies | |
run: > | |
sudo apt-get update && sudo apt-get install -y | |
libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev | |
gstreamer1.0-dev libgstreamer-plugins-base1.0-dev | |
libavahi-compat-libdnssd-dev | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Run clippy on packages without TLS requirements | |
run: cargo hack clippy -p librespot-protocol --each-feature | |
- name: Run clippy with native-tls | |
run: > | |
cargo hack clippy -p librespot --each-feature --exclude-all-features | |
--include-features native-tls | |
--exclude-features rustls-tls-native-roots,rustls-tls-webpki-roots | |
- name: Run clippy with rustls-tls-native-roots | |
run: > | |
cargo hack clippy -p librespot --each-feature --exclude-all-features | |
--include-features rustls-tls-native-roots | |
--exclude-features native-tls,rustls-tls-webpki-roots | |
- name: Run clippy with rustls-tls-webpki-roots | |
run: > | |
cargo hack clippy -p librespot --each-feature --exclude-all-features | |
--include-features rustls-tls-webpki-roots | |
--exclude-features native-tls,rustls-tls-native-roots |