Explorar el Código

Refactor LTO configuration step based on env variable

Updated the LTO configuration step to conditionally enable full or thin LTO based on the LTO environment variable.
jimsterino98 hace 2 semanas
padre
commit
f20fa6dfdf
Se han modificado 1 ficheros con 15 adiciones y 5 borrados
  1. 15 5
      .github/actions/lto/action.yml

+ 15 - 5
.github/actions/lto/action.yml

@@ -4,10 +4,20 @@ description: samsung seems to have no LTO in their kernels, this enables it
 runs:
  using: composite
  steps:
-  - name: enable FULL LTO
+  - name: configure LTO based on env variable
     shell: bash
     run: |
-     "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG
-     "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_NONE
-     "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_CLANG_FULL
-     "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG_THIN
+     if [[ "$LTO" == "full" ]]; then
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_NONE
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_CLANG_THIN
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG_FULL
+      
+     elif [[ "$LTO" == "thin" ]]; then
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_NONE
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --disable CONFIG_LTO_CLANG_FULL
+      "$COMMON/scripts/config" --file "$GKI_DEFCONFIG" --enable CONFIG_LTO_CLANG_THIN
+     else
+      echo "LTO is default, no changes to defconfig"
+     fi