Skip to content

Commit 9bd83a5

Browse files
committed
test: test
test DNR Signed-off-by: Jamie McCrae <[email protected]>
1 parent 39ccfef commit 9bd83a5

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

.github/workflows/compliance.yml

Lines changed: 40 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,95 @@
11
name: Compliance
22

3-
# Controls when the workflow will run
4-
on:
5-
pull_request:
6-
types: [opened, synchronize, reopened]
3+
on: pull_request
74

8-
# Allows you to run this workflow manually from the Actions tab
9-
workflow_dispatch:
5+
permissions:
6+
contents: read
107

11-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
128
jobs:
13-
# This workflow contains a single job called "build"
149
compliance_job:
15-
# The type of runner that the job will run on
16-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1711
name: Run compliance checks on patch series (PR)
18-
19-
# Steps represent a sequence of tasks that will be executed as part of the job
2012
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- name: Checkout the code
23-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
13+
- name: Update PATH for west
14+
run: |
15+
echo "$HOME/.local/bin" >> $GITHUB_PATH
16+
17+
- name: Checkout sources
18+
uses: nrfconnect/action-checkout-west-update@main
2419
with:
25-
path: nrf-bm
26-
ref: ${{ github.event.pull_request.head.sha }}
27-
fetch-depth: 0
20+
git-fetch-depth: 0
21+
git-ref: ${{ github.event.pull_request.head.sha }}
22+
rebase: true
23+
path: ncs/nrf-bm
2824

2925
- name: cache-pip
30-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
26+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
3127
with:
3228
path: ~/.cache/pip
3329
key: ${{ runner.os }}-doc-pip
3430

35-
- name: Install python prerequisites
36-
working-directory: nrf-bm
37-
run: |
38-
export PATH="$HOME/.local/bin:$PATH"
39-
pip3 install -U -r scripts/requirements.txt
40-
pip3 show -f west
41-
42-
- name: West init and update
43-
env:
44-
BASE_REF: ${{ github.base_ref }}
45-
working-directory: nrf-bm
46-
run: |
47-
git config --global user.email "[email protected]"
48-
git config --global user.name "Your Name"
49-
git remote -v
50-
# Ensure there's no merge commits in the PR
51-
#[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
52-
#(echo "::error ::Merge commits not allowed, rebase instead";false)
53-
git rebase origin/${BASE_REF}
54-
# debug
55-
git log --pretty=oneline | head -n 10
56-
west init -l . || true
57-
west config manifest.group-filter -- +ci,-optional
58-
west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log
59-
6031
- name: Install python dependencies
61-
working-directory: nrf
32+
working-directory: ncs/nrf
6233
run: |
6334
pip3 install -U pip
6435
pip3 install -U wheel
6536
grep -E "^setuptools" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
66-
grep -E "^python-magic=|^junitparser|^lxml|^gitlint|^pylint|^python-dotenv|^tabulate|^pykwalify|^yamllint|^unidiff" 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|^tabulate" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
6738
grep -E "^west" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U
6839
pip3 show -f west
6940
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)
49+
7050
- name: Run CODEOWNERS test
7151
id: codeowners
7252
env:
7353
BASE_REF: ${{ github.base_ref }}
74-
working-directory: nrf-bm
54+
working-directory: ncs/nrf-bm
7555
if: contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
7656
run: |
7757
../nrf/scripts/ci/codeowners.py -c origin/${BASE_REF}..
7858
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
64+
7965
- name: Run Compliance Tests
8066
continue-on-error: true
8167
id: compliance
8268
env:
8369
BASE_REF: ${{ github.base_ref }}
84-
working-directory: nrf-bm
70+
working-directory: ncs/nrf-bm
8571
if: contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
8672
run: |
8773
export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"
8874
# debug
8975
ls -la
9076
git log --pretty=oneline | head -n 10
91-
exec 2> compliance_errors.txt
9277
$ZEPHYR_BASE/scripts/ci/check_compliance.py --annotate \
93-
-e KconfigBasicNoModules -e ClangFormat -e SysbuildKconfigBasicNoModules \
78+
-e KconfigBasicNoModules -e ClangFormat \
79+
-e SysbuildKconfigBasicNoModules \
9480
-c origin/${BASE_REF}..
95-
if [[ $? -ne 0 ]]; then
96-
echo "$?" >&2
97-
fi
9881
9982
- name: upload-results
100-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
101-
continue-on-error: True
83+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
84+
continue-on-error: true
10285
if: contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
10386
with:
10487
name: compliance.xml
105-
path: nrf-bm/compliance.xml
88+
path: ncs/nrf-bm/compliance.xml
10689
overwrite: true
10790

10891
- name: check-warns
109-
working-directory: nrf-bm
92+
working-directory: ncs/nrf-bm
11093
if: contains(github.event.pull_request.user.login, 'dependabot[bot]') != true
11194
run: |
11295
export ZEPHYR_BASE="$(dirname "$(pwd)")/zephyr"

scripts/ci/ci-compliance.diff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/west.yml b/west.yml
2+
index 14a19d9..156cee6 100644
3+
--- a/west.yml
4+
+++ b/west.yml
5+
@@ -32,6 +32,13 @@ manifest:
6+
- zephyr
7+
- cmock
8+
- zcbor
9+
+ # For compliance CI testing only
10+
+ - matter
11+
+ - openthread
12+
+ - azure-sdk-for-c
13+
+ - trusted-firmware-m
14+
+ - memfault-firmware-sdk
15+
+ - cjson
16+
- name: sdk-nrf-bm-internal
17+
path: nrf-bm-internal

0 commit comments

Comments
 (0)