@@ -10,106 +10,106 @@ jobs:
1010 runs-on : ubuntu-24.04
1111 name : Run compliance checks on patch series (PR)
1212 steps :
13- - name : Update PATH for west
14- run : |
15- echo "$HOME/.local/bin" >> $GITHUB_PATH
13+ - name : Update PATH for west
14+ run : |
15+ echo "$HOME/.local/bin" >> $GITHUB_PATH
1616
17- - name : Checkout sources
18- uses : nrfconnect/action-checkout-west-update@main
19- with :
20- git-fetch-depth : 0
21- git-ref : ${{ github.event.pull_request.head.sha }}
22- rebase : true
23- path : ncs/nrf-bm
17+ - name : Checkout sources
18+ uses : nrfconnect/action-checkout-west-update@main
19+ with :
20+ git-fetch-depth : 0
21+ git-ref : ${{ github.event.pull_request.head.sha }}
22+ rebase : true
23+ path : ncs/nrf-bm
2424
25- - name : cache-pip
26- uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
27- with :
28- path : ~/.cache/pip
29- key : ${{ runner.os }}-doc-pip
25+ - name : cache-pip
26+ uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
27+ with :
28+ path : ~/.cache/pip
29+ key : ${{ runner.os }}-doc-pip
3030
31- - name : Install python dependencies
32- working-directory : ncs/nrf
33- run : |
34- pip3 install -U pip
35- pip3 install -U wheel
36- grep -E "^setuptools" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
37- grep -E "^python-magic=|^junitparser|^lxml|^gitlint|^pylint|^pykwalify|^yamllint|^unidiff|^vermin|^python-dotenv|^ruff|^tabulate" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
38- grep -E "^west" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
39- pip3 show -f west
31+ - name : Install python dependencies
32+ working-directory : ncs/nrf
33+ run : |
34+ pip3 install -U pip
35+ pip3 install -U wheel
36+ grep -E "^setuptools" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
37+ grep -E "^python-magic=|^junitparser|^lxml|^gitlint|^pylint|^pykwalify|^yamllint|^unidiff|^vermin|^python-dotenv|^ruff|^tabulate" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
38+ grep -E "^west" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
39+ pip3 show -f west
4040
41- - name : Run merge commits test
42- env :
43- BASE_REF : ${{ github.base_ref }}
44- working-directory : ncs/nrf-bm
45- run : |
46- # Ensure there's no merge commits in the PR
47- [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
48- (echo "::error ::Merge commits not allowed, rebase instead";false)
41+ - name : Run merge commits test
42+ env :
43+ BASE_REF : ${{ github.base_ref }}
44+ working-directory : ncs/nrf-bm
45+ run : |
46+ # Ensure there's no merge commits in the PR
47+ [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
48+ (echo "::error ::Merge commits not allowed, rebase instead";false)
4949
50- - name : Run CODEOWNERS test
51- id : codeowners
52- env :
53- BASE_REF : ${{ github.base_ref }}
54- working-directory : ncs/nrf-bm
55- if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
56- run : |
57- ../nrf/scripts/ci/codeowners.py -c origin/${BASE_REF}..
50+ - name : Run CODEOWNERS test
51+ id : codeowners
52+ env :
53+ BASE_REF : ${{ github.base_ref }}
54+ working-directory : ncs/nrf-bm
55+ if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
56+ run : |
57+ ../nrf/scripts/ci/codeowners.py -c origin/${BASE_REF}..
5858
59- - name : Get NCS modules needed for compliance tests to run
60- working-directory : ncs/nrf-bm
61- run : |
62- patch -p1 < scripts/ci/ci-compliance.diff
63- west update
59+ - name : Get NCS modules needed for compliance tests to run
60+ working-directory : ncs/nrf-bm
61+ run : |
62+ patch -p1 < scripts/ci/ci-compliance.diff
63+ west update
6464
65- - name : Run Compliance Tests
66- continue-on-error : true
67- id : compliance
68- env :
69- BASE_REF : ${{ github.base_ref }}
70- working-directory : ncs/nrf-bm
71- if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
72- run : |
73- export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"
74- # debug
75- ls -la
76- git log --pretty=oneline | head -n 10
77- $ZEPHYR_BASE/scripts/ci/check_compliance.py --annotate \
78- -e KconfigBasicNoModules -e ClangFormat \
79- -e SysbuildKconfigBasicNoModules \
80- -c origin/${BASE_REF}..
65+ - name : Run Compliance Tests
66+ continue-on-error : true
67+ id : compliance
68+ env :
69+ BASE_REF : ${{ github.base_ref }}
70+ working-directory : ncs/nrf-bm
71+ if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
72+ run : |
73+ export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"
74+ # debug
75+ ls -la
76+ git log --pretty=oneline | head -n 10
77+ $ZEPHYR_BASE/scripts/ci/check_compliance.py --annotate \
78+ -e KconfigBasicNoModules -e ClangFormat \
79+ -e SysbuildKconfigBasicNoModules \
80+ -c origin/${BASE_REF}..
8181
82- - name : upload-results
83- uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
84- continue-on-error : true
85- if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
86- with :
87- name : compliance.xml
88- path : ncs/nrf-bm/compliance.xml
89- overwrite : true
82+ - name : upload-results
83+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
84+ continue-on-error : true
85+ if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
86+ with :
87+ name : compliance.xml
88+ path : ncs/nrf-bm/compliance.xml
89+ overwrite : true
9090
91- - name : check-warns
92- working-directory : ncs/nrf-bm
93- if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
94- run : |
95- export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"
96- if [[ ! -s "compliance.xml" ]]; then
97- exit 1;
98- fi
99-
100- files=($($ZEPHYR_BASE/scripts/ci/check_compliance.py -l))
101- for file in "${files[@]}"; do
102- f="${file}.txt"
103- if [[ -s $f ]]; then
104- errors=$(cat $f)
105- errors="${errors//'%'/'%25'}"
106- errors="${errors//$'\n'/'%0A'}"
107- errors="${errors//$'\r'/'%0D'}"
108- echo "::error file=${f}::$errors"
109- exit=1
91+ - name : check-warns
92+ working-directory : ncs/nrf-bm
93+ if : contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
94+ run : |
95+ export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"
96+ if [[ ! -s "compliance.xml" ]]; then
97+ exit 1;
11098 fi
111- done
11299
113- if [ "${exit}" == "1" ]; then
114- exit 1;
115- fi
100+ files=($($ZEPHYR_BASE/scripts/ci/check_compliance.py -l))
101+ for file in "${files[@]}"; do
102+ f="${file}.txt"
103+ if [[ -s $f ]]; then
104+ errors=$(cat $f)
105+ errors="${errors//'%'/'%25'}"
106+ errors="${errors//$'\n'/'%0A'}"
107+ errors="${errors//$'\r'/'%0D'}"
108+ echo "::error file=${f}::$errors"
109+ exit=1
110+ fi
111+ done
112+
113+ if [ "${exit}" == "1" ]; then
114+ exit 1;
115+ fi
0 commit comments