Test misc1 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux Kernel PR CI | |
| on: | |
| pull_request: | |
| branches: | |
| - master # Linux kernel default branch | |
| jobs: | |
| kernel-ci: | |
| runs-on: ubuntu-latest | |
| env: | |
| ARCH: arm64 | |
| CROSS_COMPILE: aarch64-linux-gnu- | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to get full commit history | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev \ | |
| bc ccache qemu-user-static gcc-aarch64-linux-gnu git | |
| - name: Set up ccache | |
| run: | | |
| export CCACHE_DIR=$HOME/.ccache | |
| ccache -M 5G | |
| - name: Prepare kernel config | |
| run: | | |
| make ARCH=$ARCH defconfig | |
| - name: Get commits in PR | |
| id: pr_commits | |
| run: | | |
| COMMITS=$(git rev-list origin/master..HEAD --reverse | tr '\n' ' ') | |
| echo "commits=$COMMITS" >> $GITHUB_OUTPUT | |
| - name: Incrementally build commits and run checkpatch | |
| run: | | |
| set -e | |
| for commit in ${{ steps.pr_commits.outputs.commits }}; do | |
| echo "==============================" | |
| echo "Checking out commit $commit" | |
| git checkout $commit | |
| echo "Building kernel for commit $commit" | |
| make -j$(nproc) ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE | |
| echo "Running checkpatch.pl on commit $commit" | |
| git show $commit | ./scripts/checkpatch.pl --strict | |
| done |