-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (56 loc) · 1.81 KB
/
compliance.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
62
63
64
65
name: Compliance
on: pull_request
jobs:
compliance_job:
runs-on: ubuntu-22.04
name: Run compliance checks on patch series (PR)
container: ghcr.io/zephyrproject-rtos/ci:v0.26.13
# Skip job if it was triggered by Renovate Bot
if: ${{ !contains(github.actor, 'renovate') }}
steps:
- name: Checkout the code
uses: actions/checkout@v3
with:
path: thingy91x-oob
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Initialize
working-directory: thingy91x-oob
run: |
west init -l .
west config manifest.group-filter +bsec
west update -o=--depth=1 -n
- name: Run Compliance Tests
continue-on-error: true
id: compliance
shell: bash
env:
BASE_REF: ${{ github.base_ref }}
working-directory: thingy91x-oob
run: |
export ZEPHYR_BASE="../zephyr"
$ZEPHYR_BASE/scripts/ci/check_compliance.py -m Codeowners -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m KconfigBasic -c origin/${BASE_REF}..
- name: check-warns
working-directory: thingy91x-oob
shell: bash
run: |
if [[ ! -s "compliance.xml" ]]; then
exit 1;
fi
- name: check-warns
working-directory: thingy91x-oob
shell: bash
run: |
for file in Nits.txt checkpatch.txt Identity.txt Gitlint.txt pylint.txt Devicetree.txt Kconfig.txt KconfigBasic.txt Codeowners.txt; do
if [[ -s $file ]]; then
errors=$(cat $file)
errors="${errors//'%'/'%25'}"
errors="${errors//$'\n'/'%0A'}"
errors="${errors//$'\r'/'%0D'}"
echo "::error file=${file}::$errors"
exit=1
fi
done
if [[ $exit == 1 ]]; then
exit 1
fi