Skip to content
Draft
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
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ jobs:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
environment: [ubuntu-latest, macos-latest, windows-latest]
test: [with-token-0, with-token-1, without-token, ci]
index: [crates-index, tame-index]
test: [with-token-0, with-token-1, without-token]
include:
- environment: ubuntu-latest
index: crates-index
test: ci
- environment: ubuntu-latest
index: tame-index
test: ci

runs-on: ${{ matrix.environment }}

Expand Down Expand Up @@ -93,6 +101,10 @@ jobs:
run: |
EI0='-p ei --lib'
EI1='-p ei --lib'
FEATURES=
if [[ '${{ matrix.index }}' = 'tame-index' ]]; then
FEATURES='--features=cargo-unmaintained/tame-index'
fi
if [[ '${{ github.event_name }}' = 'schedule' || '${{ github.event_name }}' = 'workflow_dispatch' ]] ||
git diff --name-only ${{ github.event.pull_request.base.sha }} | grep -w 'ei' >/dev/null
then
Expand All @@ -102,21 +114,21 @@ jobs:
case '${{ matrix.test }}' in
with-token-0)
export GITHUB_TOKEN='${{ github.token }}'
cargo test --config "$GROUP_RUNNER" \
cargo test --config "$GROUP_RUNNER" $FEATURES \
$EI0 \
-- --nocapture
;;
with-token-1)
export GITHUB_TOKEN='${{ github.token }}'
cargo test --config "$GROUP_RUNNER" \
cargo test --config "$GROUP_RUNNER" $FEATURES \
$EI1 \
-- --nocapture
;;
without-token)
cargo test --config "$GROUP_RUNNER" -- --nocapture
cargo test --config "$GROUP_RUNNER" $FEATURES -- --nocapture
;;
ci)
cargo test --config "$GROUP_RUNNER" -p ci -- --nocapture
cargo test --config "$GROUP_RUNNER" $FEATURES -p ci -- --nocapture
;;
*)
exit 1
Expand Down
15 changes: 8 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ anyhow = { version = "1.0", features = ["backtrace"] }
cargo_metadata = "0.23"
chrono = "0.4"
clap = { version = "4.5", features = ["cargo", "derive", "wrap_help"] }
crates-index = { version = "3.12", features = ["git-https-reqwest"] }
crates-index = { version = "3.12", features = ["git-https-reqwest"], optional = true }
crates_io_api = "0.12.0"
curl = "0.4"
elaborate = "0.2"
env_logger = "0.11"
home = "0.5"
home = { version = "0.5", optional = true }
log = "0.4"
regex = "1.12"
remain = "0.2"
serde = "1.0"
serde_json = "1.0"
sha1_smol = { version = "1.0", features = ["std"] }
tame-index = { version = "0.26", features = ["sparse"], optional = true }
tempfile = "3.25"
termcolor = "1.4"
toml = "0.9"
Expand Down Expand Up @@ -55,17 +56,19 @@ tokio = "1.49"
elaborate = "0.2"

[features]
default = ["on-disk-cache", "lock-index"]
default = ["on-disk-cache", "crates-index"]
on-disk-cache = []
lock-index = ["libc", "windows-sys"]
crates-index = ["dep:crates-index", "dep:home", "libc", "windows-sys"]
tame-index = ["dep:tame-index", "reqwest/blocking"]
__mock_github = []
__real_github = []

# smoelius: Old feature that was renamed.
cache-repositories = ["on-disk-cache"]

# smoelius: Old feature that is no longer used.
# smoelius: Old features that are no longer used.
ei = []
lock-index = []

[lints]
workspace = true
Expand Down Expand Up @@ -114,6 +117,7 @@ pattern = [

[workspace.metadata.unmaintained]
ignore = [
"cexpr",
"foreign-types",
"libredox",
"rand_chacha",
Expand Down
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ fn main() {
#[cfg(all(feature = "cache-repositories", not(feature = "on-disk-cache")))]
println!("cargo:warning=Feature `cache-repositories` has been renamed to `on-disk-cache`");

#[cfg(all(feature = "crates-index", feature = "tame-index"))]
println!(
"cargo:warning=Both `crates-index` and `tame-index` features are enabled; \
using `tame-index`"
);

let out_dir = var_wc("OUT_DIR").unwrap();
let path_buf = PathBuf::from(out_dir).join("after_help.rs");
let contents = format!(
Expand Down
Loading
Loading