CI: enhance package detection logic
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
This commit is contained in:
parent
9737c89ce7
commit
a2b08b5cbf
|
@ -34,10 +34,18 @@ jobs:
|
||||||
|
|
||||||
- name: Determine changed packages
|
- name: Determine changed packages
|
||||||
run: |
|
run: |
|
||||||
# only detect packages with changed Makefiles
|
# only detect packages with changes
|
||||||
PACKAGES="$(git diff --diff-filter=d --name-only origin/master \
|
PKG_ROOTS=$(find . -name Makefile | grep -v ".*/src/Makefile" | sed -e 's@./\(.*\)/Makefile@\1/@')
|
||||||
| grep -E 'Makefile$|test.sh$' | grep -Ev '/files/|/src/' \
|
CHANGES=$(git diff --diff-filter=d --name-only origin/master)
|
||||||
| awk -F/ '{ print $(NF-1) }' | tr '\n' ' ')"
|
|
||||||
|
for ROOT in $PKG_ROOTS; do
|
||||||
|
for CHANGE in $CHANGES; do
|
||||||
|
if [[ "$CHANGE" == "$ROOT"* ]]; then
|
||||||
|
PACKAGES+=$(echo "$ROOT" | sed -e 's@.*/\(.*\)/@\1 @')
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
# fallback to test packages if nothing explicitly changes this is
|
# fallback to test packages if nothing explicitly changes this is
|
||||||
# should run if other mechanics in packages.git changed
|
# should run if other mechanics in packages.git changed
|
||||||
|
|
Loading…
Reference in New Issue