forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.63 KB
/
shallow_checkpatch.yml
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
---
# SPDX-License-Identifier: BSD-3-Clause
# Tools that can save round-trips to github and a lot of time:
#
# yamllint -f parsable this.yml
# pip3 install ruamel.yaml.cmd
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml
#
# github.com also has a powerful web editor that can be used without
# committing.
name: checkpatch
# yamllint disable-line rule:truthy
on: [pull_request]
jobs:
checkpatch:
runs-on: ubuntu-20.04
env:
PR_NUM: ${{github.event.number}}
CHK_CMD_OPTS: --ignore UNKNOWN_COMMIT_ID --codespell --codespellfile
/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt
steps:
# depth 2 so:
# ^1. we can show the Subject of the current target branch tip
# ^2. we reconnect/graft to the later fetch pull/1234/head,
- uses: actions/checkout@v2
with: {fetch-depth: 2}
- name: yamllint ourselves
run: yamllint .github/workflows/shallow_checkpatch.yml
- name: install codespell
run: sudo apt-get -y install codespell && dpkg -L codespell | grep dict
# See shallowness issue https://github.com/thesofproject/linux/issues/2556
- name: fetch PR commits
run: |
.github/workflows/shallowfetchPRcommits.sh \
${GITHUB_REPOSITORY} "$PR_NUM"
# show what we got
git --no-pager log --oneline --graph --decorate --max-count=50
- name: normal checkpatch
run: .github/workflows/checkpatch_list.sh ${CHK_CMD_OPTS} < PR_SHAs.txt
- name: checkpatch --strict
run: .github/workflows/checkpatch_list.sh ${CHK_CMD_OPTS}
--strict < PR_SHAs.txt