Sfoglia il codice sorgente

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 2 settimane fa
parent
commit
f20fa6dfdf
1 ha cambiato i file con 15 aggiunte e 5 eliminazioni
  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