Преглед изворни кода

Refactor build action inputs and variable usage

Removed unused input 'branch' and replaced input variables with environment variables in the build script.
jimsterino98 пре 1 месец
родитељ
комит
7854f30f8e
1 измењених фајлова са 10 додато и 16 уклоњено
  1. 10 16
      .github/actions/build/action.yml

+ 10 - 16
.github/actions/build/action.yml

@@ -1,18 +1,12 @@
 name: build kernel
 description: each samsung kernel has its own way of building the kernel, they are sorted here.
 inputs:
- branch:
-  description: 'device kernel'
-  required: true
  ccache:
   description: 'build with ccache'
   required: true
  build_type:
   description: 'make or bazel'
   required: true
- kernel_version:
-  description: 'version of kernel'
-  required: true
 
 runs:
  using: composite
@@ -25,20 +19,20 @@ runs:
      set -x
      cd "$CONFIG"
      echo "Building the kernel..."
-     if [[ ${{ inputs.branch }} == SM-A055* || ${{ inputs.branch }} == SM-X926B* ]]; then
+     if [[ $BRANCH == SM-A055* || $BRANCH == SM-X926B* ]]; then
       chmod +x build_kernel.sh
       ./build_kernel.sh || true
-     elif [[ ${{ inputs.branch }} == SM-S926* ]]; then
+     elif [[ $BRANCH == SM-S926* ]]; then
        #tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e9945:s5e9945_user_dist
        tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e9945:s5e9945_user
-      elif [[ ${{ inputs.branch }} == SM-A556* ]]; then
+      elif [[ $BRANCH == SM-A556* ]]; then
        #tools/bazel run --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e8845:s5e8845_user_dist
        tools/bazel build --nocheck_bzl_visibility --config=stamp --sandbox_debug --verbose_failures --debug_make_verbosity=I //projects/s5e8845:s5e8845_user
-     elif [[ ${{ inputs.branch }} == SM-S938B* ]]; then
+     elif [[ $BRANCH == SM-S938B* ]]; then
       sed -i '/drivers\/net\/usb\/smsc75xx\.ko/d;/drivers\/net\/usb\/smsc95xx\.ko/d' kernel_platform/common/modules.bzl
       chmod +x build_kernel_GKI.sh
       ./build_kernel_GKI.sh || true
-     elif [[ ${{ inputs.kernel_version }} == 6.* ]]; then
+     elif [[ $KERNEL_VER == 6.* ]]; then
       chmod +x build_kernel_GKI.sh
       ./build_kernel_GKI.sh || true
      elif [[ -d kernel_platform ]]; then
@@ -63,27 +57,27 @@ runs:
       ./build_kernel.sh || true
      fi
      
-     #if [[ ${{ inputs.branch }} == SM-S928B* || "${{ inputs.branch }}" == "SM-S938B-Oneui7" || "${{ inputs.branch }}" == "SM-S931B-Oneui8" || "${{ inputs.branch }}" == "SM-F741B-Oneui8" || "${{ inputs.branch }}" == "SM-X710-Oneui6.1.1" ]]; then
+     #if [[ $BRANCH == SM-S928B* || "$BRANCH" == "SM-S938B-Oneui7" || "$BRANCH" == "SM-S931B-Oneui8" || "$BRANCH" == "SM-F741B-Oneui8" || "$BRANCH" == "SM-X710-Oneui6.1.1" ]]; then
        #cd kernel_platform
        #tools/bazel build //common:kernel_aarch64
        #chmod +x build_kernel_GKI.sh
        #./build_kernel_GKI.sh || true
-     #elif [[ "${{ inputs.branch }}" == "SM-X916B" || "${{ inputs.branch }}" == "SM-F946N-Oneui7" || "${{ inputs.branch }}" == "SM-S916B-Oneui8" || "${{ inputs.branch }}" == "SM-S918B-Oneui8" || "${{ inputs.branch }}" == "SM-F946B-Oneui8" || "${{ inputs.branch }}" == "SM-S901E-Oneui8" || "${{ inputs.branch }}" == "SM-X800-Oneui8" || ${{ inputs.branch }} == SM-S911B* || "${{ inputs.branch }}" == "SM-M556B-Oneui8" ]]; then
+     #elif [[ "$BRANCH" == "SM-X916B" || "$BRANCH" == "SM-F946N-Oneui7" || "$BRANCH" == "SM-S916B-Oneui8" || "$BRANCH" == "SM-S918B-Oneui8" || "$BRANCH" == "SM-F946B-Oneui8" || "$BRANCH" == "SM-S901E-Oneui8" || "$BRANCH" == "SM-X800-Oneui8" || $BRANCH == SM-S911B* || "$BRANCH" == "SM-M556B-Oneui8" ]]; then
        #cd kernel_platform
        #tools/bazel build //common:kernel_aarch64
        #chmod +x build_kernel_GKI.sh
        #./build_kernel_GKI.sh || true
-     #elif [[ ${{ inputs.branch }} == SM-A546* || "${{ inputs.branch }}" == "SM-M146B-Oneui7-ADYJ2" || "${{ inputs.branch }}" == "SM-S908B-Oneui8-bitK" || ${{ inputs.branch }} == SM-A055* || "${{ inputs.branch }}" == "SM-X610-Oneui6.1.1-bit7" || "${{ inputs.branch }}" == "SM-A166B-Oneui7" ]]; then
+     #elif [[ $BRANCH == SM-A546* || "$BRANCH" == "SM-M146B-Oneui7-ADYJ2" || "$BRANCH" == "SM-S908B-Oneui8-bitK" || $BRANCH == SM-A055* || "$BRANCH" == "SM-X610-Oneui6.1.1-bit7" || "$BRANCH" == "SM-A166B-Oneui7" ]]; then
        #sudo apt update
        #sudo apt-get install -y libyaml-dev
        #chmod +x build_kernel.sh
        #./build_kernel.sh || true
-     #elif [[ "${{ inputs.branch }}" == "SM-A566B" ]]; then
+     #elif [[ "$BRANCH" == "SM-A566B" ]]; then
        #chmod +x build_script.sh
        #touch ./kernel-6.6/abi_symbollist.raw
        #touch ./kernel-6.6/abi_symbollist
        #./build_script.sh || true
-     #elif [[ "${{ inputs.branch }}" == "SM-A075M-Oneui7" ]]; then
+     #elif [[ "$BRANCH" == "SM-A075M-Oneui7" ]]; then
        #chmod +x build_kernel.sh
        #./build_kernel.sh
      #fi