ci: Trigger tests on Cargo.toml and Cargo.lock changes (#48412)
Finn found out the hard way that the new cool tech does not quite work at times. Back to the drawing board we go (at least partially). Closes #ISSUE Release Notes: - N/A
This commit is contained in:
1 parent
267fa5a230
commit
dd077cb31c
3 files changed
+6
-113
No files matched your search
@@ -51,8 +51,8 @@ jobs:
|
||||
if [ -z "$GITHUB_BASE_REF" ]; then
|
||||
echo "Not a PR, running full test suite"
|
||||
echo "changed_packages=" >> "$GITHUB_OUTPUT"
|
||||
elif echo "$CHANGED_FILES" | grep -qP '^(rust-toolchain\.toml|\.cargo/|\.github/)'; then
|
||||
echo "Toolchain, .github or cargo config changed, will run all tests"
|
||||
elif echo "$CHANGED_FILES" | grep -qP '^(rust-toolchain\.toml|\.cargo/|\.github/|Cargo\.(toml|lock)$)'; then
|
||||
echo "Toolchain, cargo config, or root Cargo files changed, will run all tests"
|
||||
echo "changed_packages=" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
# Extract changed packages from file paths
|
||||
@@ -65,15 +65,8 @@ jobs:
|
||||
FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "storybook" "assets" | sort -u)
|
||||
fi
|
||||
|
||||
# Parse Cargo.toml and Cargo.lock for changed dependencies
|
||||
CARGO_CHANGED_DEPS=""
|
||||
if echo "$CHANGED_FILES" | grep -qP '^Cargo\.(toml|lock)$'; then
|
||||
echo "Cargo files changed, analyzing..."
|
||||
CARGO_CHANGED_DEPS=$(./script/diff-cargo-deps "$COMPARE_REV" || true)
|
||||
fi
|
||||
|
||||
# Combine all changed packages
|
||||
ALL_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$CARGO_CHANGED_DEPS" | sort -u | grep -v '^$' || true)
|
||||
ALL_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' || true)
|
||||
|
||||
if [ -z "$ALL_CHANGED_PKGS" ]; then
|
||||
echo "No package changes detected, will run all tests"
|
||||
|
||||
Reference in new issue
Block a user