openwrt / actions-shared-workflows

4 stars 12 forks source link

kernel: fix change detection for kernel builds #14

Closed aparcar closed 6 months ago

aparcar commented 6 months ago

Targets were previously added for testing if one of the following three conditionn is true regarding the changed files:

The first condition is true for nearly any change, causing Kernels being tested all the time. The new logic changes the conditions to one of the following two:

In a quick test, this reduced tested kernel from $ALL to literally just the one which was changed.

Ansuel commented 6 months ago

The idea of testing all the target for generic changes was to check situation were of change affect other target (like changed to wireless driver used by multiple targets.

But that can triggered by the label actions... Maybe it's worth to document that?

aparcar commented 6 months ago

I'd proceed with this and improve the logic for checking if specific kernel drivers changed.

ynezz commented 6 months ago

Maybe it would help here to show what is currently wrong? For example providing the Git diff stat of changes which triggers the build check of all targets?

aparcar commented 6 months ago

So I looked at this PR and found out that all Kernels would be checked: https://github.com/openwrt/openwrt/pull/14993

Changed files:

package/boot/uboot-mediatek/patches/443-add-nokia_ea0326gmp.patch
target/linux/mediatek/dts/mt7981b-nokia-ea0326gmp.dts
package/boot/uboot-envtools/files/mediatek_filogic
package/boot/uboot-mediatek/Makefile
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

Without this patch:

---- targets to build ----

[{"target":"apm821xx","subtarget":"nand"},{"target":"apm821xx","subtarget":"sata"},{"target":"armsr","subtarget":"armv7"},{"target":"armsr","subtarget":"armv8"},{"target":"at91","subtarget":"sam9x"},{"target":"at91","subtarget":"sama5"},{"target":"at91","subtarget":"sama7"},{"target":"ath79","subtarget":"generic"},{"target":"ath79","subtarget":"mikrotik"},{"target":"ath79","subtarget":"nand"},{"target":"ath79","subtarget":"tiny"},{"target":"bcm27xx","subtarget":"bcm2708"},{"target":"bcm27xx","subtarget":"bcm2709"},{"target":"bcm27xx","subtarget":"bcm2710"},{"target":"bcm27xx","subtarget":"bcm2711"},{"target":"bcm27xx","subtarget":"bcm2712"},{"target":"bcm47xx","subtarget":"generic"},{"target":"bcm47xx","subtarget":"legacy"},{"target":"bcm47xx","subtarget":"mips74k"},{"target":"bcm4908","subtarget":"generic"},{"target":"bcm53xx","subtarget":"generic"},{"target":"bmips","subtarget":"bcm6318"},{"target":"bmips","subtarget":"bcm63268"},{"target":"bmips","subtarget":"bcm6328"},{"target":"bmips","subtarget":"bcm6358"},{"target":"bmips","subtarget":"bcm6362"},{"target":"bmips","subtarget":"bcm6368"},{"target":"d1","subtarget":"generic"},{"target":"gemini","subtarget":"generic"},{"target":"imx","subtarget":"cortexa53"},{"target":"imx","subtarget":"cortexa7"},{"target":"imx","subtarget":"cortexa9"},{"target":"ipq40xx","subtarget":"chromium"},{"target":"ipq40xx","subtarget":"generic"},{"target":"ipq40xx","subtarget":"mikrotik"},{"target":"ipq806x","subtarget":"chromium"},{"target":"ipq806x","subtarget":"generic"},{"target":"ixp4xx","subtarget":"generic"},{"target":"kirkwood","subtarget":"generic"},{"target":"lantiq","subtarget":"ase"},{"target":"lantiq","subtarget":"xrx200"},{"target":"lantiq","subtarget":"xway"},{"target":"lantiq","subtarget":"xway_legacy"},{"target":"layerscape","subtarget":"armv7"},{"target":"layerscape","subtarget":"armv8_64b"},{"target":"malta","subtarget":"be"},{"target":"mediatek","subtarget":"filogic"},{"target":"mediatek","subtarget":"mt7622"},{"target":"mediatek","subtarget":"mt7623"},{"target":"mediatek","subtarget":"mt7629"},{"target":"mpc85xx","subtarget":"p1010"},{"target":"mpc85xx","subtarget":"p1020"},{"target":"mpc85xx","subtarget":"p2020"},{"target":"mvebu","subtarget":"cortexa53"},{"target":"mvebu","subtarget":"cortexa72"},{"target":"mvebu","subtarget":"cortexa9"},{"target":"mxs","subtarget":"generic"},{"target":"octeon","subtarget":"generic"},{"target":"octeontx","subtarget":"generic"},{"target":"oxnas","subtarget":"ox820"},{"target":"pistachio","subtarget":"generic"},{"target":"qualcommax","subtarget":"ipq807x"},{"target":"ramips","subtarget":"mt7620"},{"target":"ramips","subtarget":"mt7621"},{"target":"ramips","subtarget":"mt76x8"},{"target":"ramips","subtarget":"rt288x"},{"target":"ramips","subtarget":"rt305x"},{"target":"ramips","subtarget":"rt3883"},{"target":"realtek","subtarget":"rtl838x"},{"target":"realtek","subtarget":"rtl839x"},{"target":"realtek","subtarget":"rtl930x"},{"target":"realtek","subtarget":"rtl931x"},{"target":"rockchip","subtarget":"armv8"},{"target":"sifiveu","subtarget":"generic"},{"target":"starfive","subtarget":"generic"},{"target":"sunxi","subtarget":"cortexa53"},{"target":"sunxi","subtarget":"cortexa7"},{"target":"sunxi","subtarget":"cortexa8"},{"target":"tegra","subtarget":"generic"},{"target":"x86","subtarget":"64"},{"target":"x86","subtarget":"generic"},{"target":"x86","subtarget":"geode"},{"target":"x86","subtarget":"legacy"},{"target":"zynq","subtarget":"generic"}]

---- targets to build ----

---- targets to check patch ----

[{"target":"apm821xx","subtarget":"nand"},{"target":"armsr","subtarget":"armv7"},{"target":"at91","subtarget":"sam9x"},{"target":"ath79","subtarget":"generic"},{"target":"bcm27xx","subtarget":"bcm2708"},{"target":"bcm47xx","subtarget":"generic"},{"target":"bcm4908","subtarget":"generic"},{"target":"bcm53xx","subtarget":"generic"},{"target":"bmips","subtarget":"bcm6318"},{"target":"d1","subtarget":"generic"},{"target":"gemini","subtarget":"generic"},{"target":"imx","subtarget":"cortexa53"},{"target":"ipq40xx","subtarget":"chromium"},{"target":"ipq806x","subtarget":"chromium"},{"target":"ixp4xx","subtarget":"generic"},{"target":"kirkwood","subtarget":"generic"},{"target":"lantiq","subtarget":"ase"},{"target":"layerscape","subtarget":"armv7"},{"target":"malta","subtarget":"be"},{"target":"mediatek","subtarget":"filogic"},{"target":"mpc85xx","subtarget":"p1010"},{"target":"mvebu","subtarget":"cortexa53"},{"target":"mxs","subtarget":"generic"},{"target":"octeon","subtarget":"generic"},{"target":"octeontx","subtarget":"generic"},{"target":"oxnas","subtarget":"ox820"},{"target":"pistachio","subtarget":"generic"},{"target":"qualcommax","subtarget":"ipq807x"},{"target":"ramips","subtarget":"mt7620"},{"target":"realtek","subtarget":"rtl838x"},{"target":"rockchip","subtarget":"armv8"},{"target":"sifiveu","subtarget":"generic"},{"target":"starfive","subtarget":"generic"},{"target":"sunxi","subtarget":"cortexa53"},{"target":"tegra","subtarget":"generic"},{"target":"x86","subtarget":"64"},{"target":"zynq","subtarget":"generic"}]

---- targets to check patch ----

With his patch:

---- targets to build ----

[{"target":"mediatek","subtarget":"filogic"},{"target":"mediatek","subtarget":"mt7622"},{"target":"mediatek","subtarget":"mt7623"},{"target":"mediatek","subtarget":"mt7629"}]

---- targets to build ----

---- targets to check patch ----

[{"target":"mediatek","subtarget":"filogic"}]

---- targets to check patch ----
ynezz commented 6 months ago

The idea of testing all the target for generic changes was to check situation were of change affect other target

Ok, that makes sense, but this is already handled via target/linux/generic isn't it?

(like changed to wireless driver used by multiple targets.

Can you provide such path example/PR/commit?

aparcar commented 6 months ago

I'll merge this now since actions queue up forever, specifically the container builds of snapshots. I'll see how to implement driver detection and add that to the CI in a follow up