diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2022-10-04 18:43:38 +0200 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2022-12-04 17:36:56 +0100 |
commit | 431875b3dfa117cdf051941ad9efc118bba77a44 (patch) | |
tree | c163e297660c9c9e7e563de51b879f262117b79c | |
parent | 8bbaa486cb6b7e816dc6931bcb0946786568f1d6 (diff) | |
download | upstream-431875b3dfa117cdf051941ad9efc118bba77a44.tar.gz upstream-431875b3dfa117cdf051941ad9efc118bba77a44.tar.bz2 upstream-431875b3dfa117cdf051941ad9efc118bba77a44.zip |
CI: kernel: use ccache to speedup workflow
Use ccache to speedup kernel compilation.
Ccache dir is cached across each build test. To refresh ccache directory
we generate an hash of the kernel include files, that includes the
kernel versions of every kernel supported and the kernel compile
includes.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 137ba15e6ef31534a2002a02e69b774232f0b040)
-rw-r--r-- | .github/workflows/kernel.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index c04e240192..99b8aefbe1 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -14,6 +14,7 @@ jobs: outputs: target: ${{ steps.find_targets.outputs.target }} owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} + ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} steps: - name: Checkout @@ -26,6 +27,13 @@ jobs: | tr '[:upper:]' '[:lower:]') echo "::set-output name=owner_lc::$OWNER_LC" + - name: Generate ccache hash + id: ccache_hash + run: | + CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ + | md5sum | awk '{ print $1 }') + echo "::set-output name=ccache_hash::$CCACHE_HASH" + - name: Set targets id: find_targets run: | @@ -129,6 +137,14 @@ jobs: path: openwrt/${{ env.TOOLCHAIN_FILE }} key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }} + - name: Cache ccache + uses: actions/cache@v3 + with: + path: openwrt/.ccache + key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.determine_targets.outputs.ccache_hash }} + restore-keys: | + ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- + - name: Download external toolchain if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }} shell: su buildbot -c "sh -e {0}" @@ -149,6 +165,7 @@ jobs: echo CONFIG_ALL_KMODS=y >> .config echo CONFIG_DEVEL=y >> .config echo CONFIG_AUTOREMOVE=y >> .config + echo CONFIG_CCACHE=y >> .config ./scripts/ext-toolchain.sh \ --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ |