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: 26 additions & 0 deletions .github/scripts/generate-lockfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# This script generates the lockfile for the current toolchain.
# It is only necessary because the MSRV is currently lower than 1.84.0,
# which is the minimum needed for resolver v3.
# If and when the MSRV is raised to or above 1.84.0, this script can be
# replaced by a simple `cargo generate-lockfile`.

set -e

RESOLVER_V3_MIN_VERSION='1.84.0'
VERSION="$(cargo --version | cut -d' ' -f2)"

LOWER_VERSION="$(echo -e "$RESOLVER_V3_MIN_VERSION\n$VERSION" | sort --version-sort | head -n1)"

if [[ "$LOWER_VERSION" == "$RESOLVER_V3_MIN_VERSION" ]]; then
cargo generate-lockfile
else
# must declare workspace resolver, or it defaults to v1
sed -Ei '/resolver ?=/ s/3/2/' Cargo.toml

cargo generate-lockfile

# manually downgrade dependencies to compatible versions
cargo update --package unicode-segmentation --precise 1.12.0
fi
11 changes: 7 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ jobs:
- name: Check formatting
run: cargo fmt --all -- --check

- name: Generate lockfile
run: .github/scripts/generate-lockfile.sh

- name: Run clippy
run: |
cargo clippy --workspace -- -D warnings
cargo clippy --workspace --no-default-features -- -D warnings
cargo clippy --locked -- -D warnings
cargo clippy --locked --no-default-features -- -D warnings

- name: Run tests
run: |
cargo test --workspace
cargo test --workspace --no-default-features
cargo test --locked
cargo test --locked --no-default-features
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ documented = { path = "lib", default-features = false }
documented-macros = { path = "documented-macros", version = "0.9.2" }
itertools = "0.15.0"
optfield = "0.4.0"
phf = { version = "0.14", default-features = false, features = ["macros"] }
phf = { version = "0.13", default-features = false, features = ["macros"] }
proc-macro2 = "1.0.95"
quote = "1.0.40"
strum = { version = "0.28.0", features = ["derive"] }
Expand Down