From 170cd3f912fcc66fba33428842b9d88a0b4092f1 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 4 Mar 2024 19:12:48 +0800 Subject: [PATCH] ci: Add android 15 avd kernel (#1414) --- ...d-14-avd.xml => android-14-avd_x86_64.xml} | 0 .github/manifests/android-15-avd_aarch64.xml | 37 +++++++++++++++++++ .github/workflows/avd-kernel.yml | 16 +++++--- .github/workflows/build-kernel-a14-avd.yml | 27 -------------- .github/workflows/build-kernel-avd.yml | 37 +++++++++++++++++++ 5 files changed, 84 insertions(+), 33 deletions(-) rename .github/manifests/{android-14-avd.xml => android-14-avd_x86_64.xml} (100%) create mode 100644 .github/manifests/android-15-avd_aarch64.xml delete mode 100644 .github/workflows/build-kernel-a14-avd.yml create mode 100644 .github/workflows/build-kernel-avd.yml diff --git a/.github/manifests/android-14-avd.xml b/.github/manifests/android-14-avd_x86_64.xml similarity index 100% rename from .github/manifests/android-14-avd.xml rename to .github/manifests/android-14-avd_x86_64.xml diff --git a/.github/manifests/android-15-avd_aarch64.xml b/.github/manifests/android-15-avd_aarch64.xml new file mode 100644 index 00000000..6591a1af --- /dev/null +++ b/.github/manifests/android-15-avd_aarch64.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/workflows/avd-kernel.yml b/.github/workflows/avd-kernel.yml index d53722db..baf8e4a3 100644 --- a/.github/workflows/avd-kernel.yml +++ b/.github/workflows/avd-kernel.yml @@ -9,6 +9,11 @@ on: description: > With SUBLEVEL of kernel, for example: android12-5.10.66 + arch: + required: true + type: string + description: > + Build arch: aarch64/x86_64 debug: required: false type: boolean @@ -106,7 +111,7 @@ jobs: if: inputs.use_cache == true uses: hendrikmuhs/ccache-action@v1.2 with: - key: gki-kernel-x86_64-avd-${{ inputs.version_name }} + key: gki-kernel-${{ inputs.arch }}-avd-${{ inputs.version_name }} max-size: 2G save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} @@ -126,15 +131,15 @@ jobs: export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }} export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }} fi - tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common-modules/virtual-device:virtual_device_x86_64_dist -- --dist_dir=dist - NAME=kernel-x86_64-avd-${{ inputs.version_name }}-${{ env.kernelsu_version }} + tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common-modules/virtual-device:virtual_device_${{ inputs.arch }}_dist -- --dist_dir=dist + NAME=kernel-${{ inputs.arch }}-avd-${{ inputs.version_name }}-${{ env.kernelsu_version }} mv dist/bzImage $NAME echo "file_path=android-kernel/$NAME" >> $GITHUB_ENV - name: Upload Kernel uses: actions/upload-artifact@v4 with: - name: kernel-x86_64-avd-${{ inputs.version_name }}-${{ env.kernelsu_version }} + name: kernel-${{ inputs.arch }}-avd-${{ inputs.version_name }}-${{ env.kernelsu_version }} path: "${{ env.file_path }}" - name: Bot session cache @@ -155,7 +160,7 @@ jobs: COMMIT_URL: ${{ github.event.head_commit.url }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} run: | - TITLE=kernel-x86_64-avd-${{ inputs.version_name }} + TITLE=kernel-${{ inputs.arch }}-avd-${{ inputs.version_name }} echo "[+] title: $TITLE" export TITLE export VERSION="${{ env.kernelsu_version }}" @@ -165,4 +170,3 @@ jobs: pip3 install telethon==1.31.1 python3 "$GITHUB_WORKSPACE/KernelSU/scripts/ksubot.py" "${{ env.file_path }}" fi - diff --git a/.github/workflows/build-kernel-a14-avd.yml b/.github/workflows/build-kernel-a14-avd.yml deleted file mode 100644 index ce8d0372..00000000 --- a/.github/workflows/build-kernel-a14-avd.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build Kernel - Android 14 AVD -on: - push: - branches: ["main", "ci", "checkci"] - paths: - - ".github/workflows/build-kernel-a14.yml" - - ".github/workflows/avd-kernel.yml" - - ".github/workflows/manifests/android-14-avd.xml" - - "kernel/**" - pull_request: - branches: ["main"] - paths: - - ".github/workflows/build-kernel-a14-avd.yml" - - ".github/workflows/avd-kernel.yml" - - ".github/workflows/manifests/android-14-avd.xml" - - "kernel/**" - workflow_call: - workflow_dispatch: -jobs: - build-kernel: - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/checkci' - uses: ./.github/workflows/avd-kernel.yml - secrets: inherit - with: - version_name: android-14 - manifest_name: android-14-avd.xml - debug: true diff --git a/.github/workflows/build-kernel-avd.yml b/.github/workflows/build-kernel-avd.yml new file mode 100644 index 00000000..5ab1f125 --- /dev/null +++ b/.github/workflows/build-kernel-avd.yml @@ -0,0 +1,37 @@ +name: Build Kernel - Android 14 AVD +on: + push: + branches: ["main", "ci", "checkci"] + paths: + - ".github/workflows/build-kernel-avd.yml" + - ".github/workflows/avd-kernel.yml" + - ".github/workflows/manifests/*xml" + - "kernel/**" + pull_request: + branches: ["main"] + paths: + - ".github/workflows/build-kernel-avd.yml" + - ".github/workflows/avd-kernel.yml" + - ".github/workflows/manifests/*.xml" + - "kernel/**" + workflow_call: + workflow_dispatch: +jobs: + build-kernel: + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/checkci' + uses: ./.github/workflows/avd-kernel.yml + secrets: inherit + strategy: + matrix: + include: + - version: "android-14-avd_x86_64" + manifest: "android-14-avd_x86_64.xml" + arch: "x86_64" + - version: "android-15-avd_aarch64" + manifest: "android-15-avd_aarch64.xml" + arch: "aarch64" + with: + version_name: ${{ matrix.version }} + manifest_name: ${{ matrix.manifest }} + arch: ${{ matrix.arch }} + debug: true