feat(kmod): separete build for kunit #319
Workflow file for this run
This file contains 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: build test kmod | |
on: | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
build: | |
if: ${{ github.event.label.name == 'run-build-test' }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set PR fetch depth | |
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | |
- name: Check for .c file changes | |
id: check_changes | |
run: | | |
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '\.c$'; then | |
echo ".c files changed" | |
echo "c_changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "No .c files changed" | |
echo "c_changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Build kmod | |
if: steps.check_changes.outputs.c_changed == 'true' | |
run: | | |
cd agnocast_kmod | |
make | |