ci: use ccache (#78)

This commit is contained in:
秋秋
2023-01-17 19:56:39 +08:00
committed by GitHub
parent d8009500a4
commit 965412377d
5 changed files with 129 additions and 4 deletions

View File

@@ -29,11 +29,20 @@ jobs:
name: Build WSA-Kernel-${{ matrix.version }}
runs-on: ubuntu-18.04
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
steps:
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-WSA-Kernel-${{ matrix.version }}
append-timestamp: false
- uses: actions/checkout@v3
with:
path: KernelSU
- name: Install LLVM
run: |
sudo apt install -y --no-install-recommends bc bison build-essential ca-certificates flex git gnupg libelf-dev libssl-dev lsb-release software-properties-common wget libncurses-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu nuget
@@ -79,7 +88,7 @@ jobs:
cp configs/wsa/${{ matrix.make_config }}-5.10 $KERNEL_ROOT/.config
echo "[+] 复制配置文件 configs/wsa/${{ matrix.make_config }}-5.10 到 $KERNEL_ROOT/.config"
echo "执行: make -j`nproc` LLVM=1 ${{ matrix.kernel_make_cmd }}"
make -j`nproc` LLVM=1 ${{ matrix.kernel_make_cmd }}
make -j`nproc` LLVM=1 ${{ matrix.kernel_make_cmd }} CCACHE="/usr/bin/ccache"
- name: Upload kernel-${{ matrix.arch }}-${{ matrix.version }}
uses: actions/upload-artifact@v3

View File

@@ -37,11 +37,21 @@ jobs:
name: Build aarch64-${{ matrix.version }}
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
steps:
- uses: actions/checkout@v3
with:
path: KernelSU
fetch-depth: 0
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-aarch64-${{ matrix.version }}
append-timestamp: false
- name: Setup need_upload
id: need_upload
run: |
@@ -93,7 +103,7 @@ jobs:
- name: Build boot.img
working-directory: android-kernel
run: BUILD_BOOT_IMG=1 SKIP_VENDOR_BOOT=1 KERNEL_BINARY=Image GKI_RAMDISK_PREBUILT_BINARY=out/ramdisk AVB_SIGN_BOOT_IMG=1 AVB_BOOT_PARTITION_SIZE=$((64*1024*1024)) AVB_BOOT_ALGORITHM=SHA256_RSA2048 AVB_BOOT_KEY=prebuilts/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem BOOT_IMAGE_HEADER_VERSION=4 LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
run: CCACHE="/usr/bin/ccache" BUILD_BOOT_IMG=1 SKIP_VENDOR_BOOT=1 KERNEL_BINARY=Image GKI_RAMDISK_PREBUILT_BINARY=out/ramdisk AVB_SIGN_BOOT_IMG=1 AVB_BOOT_PARTITION_SIZE=$((64*1024*1024)) AVB_BOOT_ALGORITHM=SHA256_RSA2048 AVB_BOOT_KEY=prebuilts/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem BOOT_IMAGE_HEADER_VERSION=4 LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
- name: Build boot-lz4.img
working-directory: android-kernel

View File

@@ -25,11 +25,21 @@ jobs:
name: Build aarch64-${{ matrix.version }}
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
steps:
- uses: actions/checkout@v3
with:
path: KernelSU
fetch-depth: 0
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-aarch64-${{ matrix.version }}
append-timestamp: false
- name: Setup need_upload
id: need_upload
run: |
@@ -81,7 +91,7 @@ jobs:
- name: Build boot.img
working-directory: android-kernel
run: BUILD_BOOT_IMG=1 SKIP_VENDOR_BOOT=1 KERNEL_BINARY=Image AVB_SIGN_BOOT_IMG=1 AVB_BOOT_PARTITION_SIZE=$((64*1024*1024)) AVB_BOOT_ALGORITHM=SHA256_RSA2048 AVB_BOOT_KEY=prebuilts/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem BOOT_IMAGE_HEADER_VERSION=4 LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
run: CCACHE="/usr/bin/ccache" BUILD_BOOT_IMG=1 SKIP_VENDOR_BOOT=1 KERNEL_BINARY=Image AVB_SIGN_BOOT_IMG=1 AVB_BOOT_PARTITION_SIZE=$((64*1024*1024)) AVB_BOOT_ALGORITHM=SHA256_RSA2048 AVB_BOOT_KEY=prebuilts/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem BOOT_IMAGE_HEADER_VERSION=4 LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
- name: Upload boot.img
uses: actions/upload-artifact@v3