-
Notifications
You must be signed in to change notification settings - Fork 318
61 lines (52 loc) · 1.96 KB
/
codestyle.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
51
52
53
54
55
56
57
58
59
60
61
---
# 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: codestyle
# yamllint disable-line rule:truthy
on: [pull_request]
jobs:
checkpatch:
runs-on: ubuntu-20.04
env:
PR_NUM: ${{github.event.number}}
# TODO: reduce duplication with scripts/sof-*-commit-hook.sh
# thanks to either some .conf file or some wrapper script
CHK_CMD_OPTS: --ignore UNKNOWN_COMMIT_ID --codespell
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@v3
with: {fetch-depth: 2}
- 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
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: run yamllint
# Quoting to please all parsers is hard. This indirection helps.
env:
yamllint_config: '{extends: default, rules: {line-length: {max: 100}}}'
run: yamllint -f parsable
-d "$yamllint_config"
--strict .github/workflows/*.yml