Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Split CI clippy into main & auxiliary steps. #155

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ env:
# then please feel free to submit a PR that adjusts it along with the potential clippy fixes.
RUST_STABLE_VER: "1.71" # In quotes because otherwise 1.70 would be interpreted as 1.7

# Rationale
#
# We don't run clippy with --all-targets because then even --lib and --bins are compiled with
# dev dependencies enabled, which does not match how they would be compiled by users.
# A dev dependency might enable a feature of a regular dependency that we need, but testing
# with --all-targets would not catch that. Thus we split --lib & --bins into a separate step.

name: CI

on:
push:
branches:
- main
pull_request:
merge_group:

Expand Down Expand Up @@ -55,15 +59,26 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: cargo clippy (no default features)
run: cargo clippy --workspace --all-targets --no-default-features -- -D warnings
run: cargo clippy --workspace --lib --bins --no-default-features -- -D warnings
# No default features means no backend on Linux, so we won't run it
if: contains(matrix.os, 'ubuntu') == false

- name: cargo clippy (no default features) (auxiliary)
run: cargo clippy --workspace --tests --benches --examples --no-default-features -- -D warnings
# No default features means no backend on Linux, so we won't run it
if: contains(matrix.os, 'ubuntu') == false

- name: cargo clippy (default features)
run: cargo clippy --workspace --all-targets -- -D warnings
run: cargo clippy --workspace --lib --bins -- -D warnings

- name: cargo clippy (default features) (auxiliary)
run: cargo clippy --workspace --tests --benches --examples -- -D warnings

- name: cargo clippy (all features)
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
run: cargo clippy --workspace --lib --bins --all-features -- -D warnings

- name: cargo clippy (all features) (auxiliary)
run: cargo clippy --workspace --tests --benches --examples --all-features -- -D warnings

- name: cargo test
run: cargo test --workspace --all-features
Expand Down