Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable

- name: Set up compilation cache (sccache)
uses: mozilla-actions/sccache-action@v0.0.9
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9

- name: Install nextest
uses: taiki-e/install-action@nextest
uses: taiki-e/install-action@e32179aa3c2a47939bd07439bd80ddf13f99979f # nextest
with:
tool: nextest

- name: Run tests
run: cargo ci-test
Expand All @@ -35,15 +39,16 @@ jobs:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
components: rustfmt

- name: Set up compilation cache (sccache)
uses: mozilla-actions/sccache-action@v0.0.9
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9

- name: Check formatting
run: cargo ci-fmt
Expand All @@ -52,15 +57,16 @@ jobs:
name: Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
components: clippy

- name: Set up compilation cache (sccache)
uses: mozilla-actions/sccache-action@v0.0.9
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9

- name: Run clippy
run: cargo ci-lint
4 changes: 2 additions & 2 deletions .github/workflows/deploy-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build-and-deploy:
runs-on: [self-hosted, linux, x64, ref-solver-deploy]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Setup Rust
run: |
Expand All @@ -30,7 +30,7 @@ jobs:
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Cache cargo registry
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
uses: MarcoIeni/release-plz-action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
8 changes: 1 addition & 7 deletions src/catalog/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,13 +987,7 @@ impl std::fmt::Display for BuildSummary {
writeln!(f)?;

writeln!(f, "Coverage:")?;
let pct = |n: usize, total: usize| {
if total == 0 {
0
} else {
(n * 100) / total
}
};
let pct = |n: usize, total: usize| (n * 100).checked_div(total).unwrap_or(0);
let check = |n: usize, total: usize| {
if n == total {
"+"
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<'a> CandidateFinder<'a> {
}

let mut candidates: Vec<_> = ref_counts.into_iter().collect();
candidates.sort_by(|a, b| b.1.cmp(&a.1)); // Sort by count descending
candidates.sort_by_key(|b| std::cmp::Reverse(b.1)); // Sort by count descending
candidates
}

Expand Down Expand Up @@ -68,7 +68,7 @@ impl<'a> CandidateFinder<'a> {
}

let mut candidates: Vec<_> = ref_counts.into_iter().collect();
candidates.sort_by(|a, b| b.1.cmp(&a.1));
candidates.sort_by_key(|b| std::cmp::Reverse(b.1));
candidates
}

Expand Down
Loading