2021-03-05 03:21:22 +08:00
|
|
|
---
|
|
|
|
# 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.
|
|
|
|
|
2021-05-04 06:34:37 +08:00
|
|
|
name: codestyle
|
2021-03-05 03:21:22 +08:00
|
|
|
|
|
|
|
# yamllint disable-line rule:truthy
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
checkpatch:
|
|
|
|
runs-on: ubuntu-20.04
|
2022-06-04 05:46:03 +08:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
strictness: [null, --strict]
|
|
|
|
|
2021-03-05 03:21:22 +08:00
|
|
|
env:
|
|
|
|
PR_NUM: ${{github.event.number}}
|
2021-03-31 06:51:42 +08:00
|
|
|
# TODO: reduce duplication with scripts/sof-*-commit-hook.sh
|
|
|
|
# thanks to either some .conf file or some wrapper script
|
2021-10-21 17:34:08 +08:00
|
|
|
CHK_CMD_OPTS: --ignore UNKNOWN_COMMIT_ID --codespell
|
2021-12-02 04:06:06 +08:00
|
|
|
|
2021-03-05 03:21:22 +08:00
|
|
|
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: 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
|
|
|
|
|
2022-06-04 05:46:03 +08:00
|
|
|
- name: checkpatch
|
|
|
|
env:
|
|
|
|
STRICTNESS: ${{ matrix.strictness }}
|
2021-03-09 03:55:49 +08:00
|
|
|
run: .github/workflows/checkpatch_list.sh ${CHK_CMD_OPTS}
|
2022-06-04 05:46:03 +08:00
|
|
|
${STRICTNESS} < PR_SHAs.txt
|
|
|
|
|
2021-05-04 06:34:37 +08:00
|
|
|
yamllint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: run yamllint
|
2022-09-17 08:30:23 +08:00
|
|
|
# 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 *.yml
|