-
Notifications
You must be signed in to change notification settings - Fork 19
98 lines (90 loc) · 2.86 KB
/
kernel_checker.yml
File metadata and controls
98 lines (90 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Kernel Checkers
on:
workflow_dispatch:
inputs:
pr:
description: Pull request number
type: string
required: true
sha:
description: Head sha of the PR
type: string
required: true
ref:
description: Target branch
type: string
required: true
repo:
description: Target repository
type: string
required: true
jobs:
init-status:
runs-on: ubuntu-latest
steps:
- name: Initial workflow status
uses: qualcomm-linux/kernel-config/.github/actions/workflow_status@main
with:
sha: ${{ inputs.sha }}
action_mode: start
check_name: kernel-checker
repo: ${{ inputs.repo }}
GH_TOKEN: ${{ secrets.PAT }}
prepare:
runs-on:
group: GHA-Kernel-SelfHosted-RG
labels: [ self-hosted, kernel-prd-u2404-x64-large-od-ephem ]
steps:
- name: Checkout PR Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get base sha
id: get_sha
run: |
pr=${{ inputs.pr }}
data=$(curl -H "Authorization: token ${{secrets.PAT}}" https://api.github.com/repos/${{inputs.repo}}/pulls/$pr)
base_sha=$(echo "$data" | jq -r '.base.sha')
echo "Base SHA: $base_sha"
echo "base_sha=$base_sha" >> "$GITHUB_OUTPUT"
- name: Set kernel workspace path
id: set_kernel_src
run: |
GITHUB_WORKSPACE=${{ github.workspace }}
if [[ ${{ inputs.repo }} =~ "kernel-topics" ]]; then
echo "kernel_src=$GITHUB_WORKSPACE/kernel" >> "$GITHUB_OUTPUT"
else
echo "kernel_src=$GITHUB_WORKSPACE" >> "$GITHUB_OUTPUT"
fi
outputs:
kernel_src: ${{ steps.set_kernel_src.outputs.kernel_src }}
base_sha: ${{ steps.get_sha.outputs.base_sha }}
checker:
needs: [prepare, init-status]
uses: qualcomm-linux/kernel-checkers/.github/workflows/checker.yml@main
with:
check_name: ${{ matrix.check }}
kernel_src: ${{ needs.prepare.outputs.kernel_src }}
base_sha: ${{ needs.prepare.outputs.base_sha }}
head_sha: ${{ inputs.sha }}
base_branch: ${{ inputs.ref }}
pr_number: ${{ inputs.pr }}
topic_repo: ${{ inputs.repo }}
strategy:
matrix:
check: [check-patch-compliance, check-uapi-headers, sparse-check, checkpatch,
dt-binding-check, dtb-check]
fail-fast: false
final-status:
runs-on: ubuntu-latest
needs: [checker]
if: always()
steps:
- name: Final workflow status
uses: qualcomm-linux/kernel-config/.github/actions/workflow_status@main
with:
sha: ${{ inputs.sha }}
action_mode: ${{ needs.checker.result }}
check_name: kernel-checker
repo: ${{ inputs.repo }}
GH_TOKEN: ${{ secrets.PAT }}