Prechádzať zdrojové kódy

ci(build): simplify abi check bypass logic in workflow

Refactor the conditional checks for different Android and kernel versions to use elif statements for better readability. Also update the bypass logic for Android 14+ versions to modify a different file and use Python syntax instead of shell commands.
TheWildJames 10 mesiacov pred
rodič
commit
67f50563b9
1 zmenil súbory, kde vykonal 10 pridanie a 20 odobranie
  1. 10 20
      .github/workflows/build.yml

+ 10 - 20
.github/workflows/build.yml

@@ -448,26 +448,16 @@ jobs:
           # Edit each block as needed per version
           # Edit each block as needed per version
           if [[ "${{ inputs.android_version }}" == "android12" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
           if [[ "${{ inputs.android_version }}" == "android12" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
             sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
             sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
-          fi
-
-          if [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
-            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
-          fi
-
-          if [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
-            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
-          fi
-
-          if [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
-            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
-          fi
-
-          if [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then
-            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
-          fi
-
-          if [[ "${{ inputs.android_version }}" == "android15" && "${{ inputs.kernel_version }}" == "6.6" ]]; then
-            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/abi/compare_to_symbol_list
+          elif [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
+            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/kernel/abi/compare_to_symbol_list
+          elif [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
+            sed -i 's/^\s*exit 1$/    echo "Who cares? Bypassing now!"/' build/kernel/abi/compare_to_symbol_list
+          elif [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
+            sed -i '/if missing_symbols:/,/return 1/ s/return 1$/    print("Who cares! Bypassing now!")\n    return 0/' build/kernel/abi/check_buildtime_symbol_protection.py
+          elif [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then
+            sed -i '/if missing_symbols:/,/return 1/ s/return 1$/    print("Who cares! Bypassing now!")\n    return 0/' build/kernel/abi/check_buildtime_symbol_protection.py
+          elif [[ "${{ inputs.android_version }}" == "android15" && "${{ inputs.kernel_version }}" == "6.6" ]]; then
+            sed -i '/if missing_symbols:/,/return 1/ s/return 1$/    print("Who cares! Bypassing now!")\n    return 0/' build/kernel/abi/check_buildtime_symbol_protection.py
           fi
           fi
 
 
       - name: Configure Build Optimization
       - name: Configure Build Optimization