Skip to content

Commit 58f5c1e

Browse files
[nrf noup] Switch to separate workflow dedicated to ncs
Leave examples-nrfconnect.yaml the same as in upstream to avoid conflicts. Instead use the dedicated nrfconnect-ncs.yaml workflow. Update also ot-relatek and pigweed due to wrong alignment with upstream. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent 4c78bef commit 58f5c1e

File tree

4 files changed

+241
-45
lines changed

4 files changed

+241
-45
lines changed
Lines changed: 134 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2020 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
name: Build example - nRF Connect SDK
216

317
on:
@@ -7,12 +21,6 @@ on:
721
- 'v*-branch'
822
pull_request:
923
merge_group:
10-
workflow_dispatch:
11-
inputs:
12-
ncs_revision:
13-
description: "NCS branch or commit SHA"
14-
required: true
15-
default: "origin/master"
1624

1725
concurrency:
1826
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
@@ -34,59 +42,142 @@ jobs:
3442
container:
3543
image: ghcr.io/project-chip/chip-build-nrf-platform:174
3644
volumes:
45+
- "/:/runner-root-volume"
3746
- "/tmp/bloat_reports:/tmp/bloat_reports"
3847

3948
steps:
4049
- name: Checkout
41-
uses: actions/checkout@v4
50+
uses: actions/checkout@v5
4251
- name: Checkout submodules & Bootstrap
4352
uses: ./.github/actions/checkout-submodules-and-bootstrap
4453
with:
4554
platform: nrfconnect
46-
# Workaround, in docker image there is a change in the zephyr-env.sh script that breaks the checkout process.
47-
# We need to restore the zephyr-env.sh script to the original state.
48-
# It should be fixed during the next NCS bump in the Matter upstream repository.
49-
- name: Pre-update NCS
55+
- name: Detect changed paths
56+
uses: dorny/paths-filter@v3
57+
id: changed_paths
58+
with:
59+
filters: |
60+
nrfconnect:
61+
- '**/nrfconnect/**'
62+
- '**/Zephyr/**'
63+
- '**/zephyr/**'
64+
pigweed:
65+
- 'src/pw_backends/**'
66+
- 'third_party/pigweed/**'
67+
tests:
68+
- '**/tests/**'
69+
shell:
70+
- 'examples/shell/nrfconnect/**'
71+
crypto:
72+
- 'src/crypto/**'
73+
- name: Set up environment for size reports
74+
uses: ./.github/actions/setup-size-reports
75+
if: ${{ !env.ACT }}
76+
with:
77+
gh-context: ${{ toJson(github) }}
78+
- name: Check nRF Connect SDK revision.
79+
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check"
80+
- name: Run unit tests of factory data generation script
81+
run: scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"
82+
- name: Build example nRF Connect SDK Lock App on nRF52840 DK
83+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
5084
run: |
51-
git -C /opt/NordicSemiconductor/nrfconnect/zephyr stash
52-
- name: Update NCS recommended version (workflow_dispatch)
53-
if: github.event_name == 'workflow_dispatch'
85+
scripts/examples/nrfconnect_example.sh lock-app nrf52840dk/nrf52840
86+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
87+
nrfconnect nrf52840dk_nrf52840 lock-app \
88+
examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
89+
/tmp/bloat_reports/
90+
rm -rf examples/lock-app/nrfconnect/build/nrfconnect
91+
- name: Build example nRF Connect SDK Lock App on nRF54L15 DK
92+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
5493
run: |
55-
echo "Using NCS from ${{ github.event.inputs.ncs_revision }}"
56-
echo "${{ github.event.inputs.ncs_revision }}" > config/nrfconnect/.nrfconnect-recommended-revision
57-
- name: Update NCS recommended version (pull_request)
58-
if: github.event_name == 'pull_request'
59-
env:
60-
PR_DESCRIPTION: "${{ github.event.pull_request.body }}"
94+
scripts/examples/nrfconnect_example.sh lock-app nrf54l15dk/nrf54l15/cpuapp
95+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
96+
nrfconnect nrf54l15dk_nrf54l15_cpuapp lock-app \
97+
examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
98+
/tmp/bloat_reports/
99+
rm -rf examples/lock-app/nrfconnect/build/nrfconnect
100+
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
101+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
61102
run: |
62-
if [ -n "$PR_DESCRIPTION" ]; then
63-
NCS_PR_ID=$(echo $PR_DESCRIPTION | { grep 'NCS PR' || true; } | sed 's/.*nrfconnect\/sdk-nrf//' | { grep -oE '[0-9]+' || true; })
64-
if [ -n "$NCS_PR_ID" ]; then
65-
echo "Using NCS from pull/$NCS_PR_ID/head"
66-
git -C $ZEPHYR_BASE/../nrf fetch origin pull/$NCS_PR_ID/head:NCS_PR
67-
echo NCS_PR > config/nrfconnect/.nrfconnect-recommended-revision
68-
else
69-
echo "Using NCS from $(cat config/nrfconnect/.nrfconnect-recommended-revision)"
70-
fi
71-
fi
72-
- name: Check nRF Connect SDK revision.
73-
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --update"
74-
continue-on-error: true
75-
- name: Run unit tests of factory data generation script
103+
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle/nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y
104+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
105+
nrfconnect nrf52840dongle_nrf52840 lighting-app \
106+
examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
107+
/tmp/bloat_reports/
108+
rm -rf examples/lighting-app/nrfconnect/build/nrfconnect
109+
- name: Build example nRF Connect SDK Lighting App on nRF54L15 DK
110+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
76111
run: |
77-
scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt'
78-
scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"
79-
- name: Run unit tests for Zephyr native_posix_64 platform with NVS
112+
scripts/examples/nrfconnect_example.sh lighting-app nrf54l15dk/nrf54l15/cpuapp
113+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
114+
nrfconnect nrf54l15dk_nrf54l15_cpuapp lighting-app \
115+
examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
116+
/tmp/bloat_reports/
117+
rm -rf examples/lighting-app/nrfconnect/build/nrfconnect
118+
- name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC
119+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
80120
run: |
81-
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-sim-tests build"
82-
- name: Run unit tests for Zephyr native_posix_64 platform with ZMS
121+
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk/nrf52840 -DOVERLAY_CONFIG=rpc.overlay
122+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
123+
nrfconnect nrf52840dk_nrf52840+rpc lighting-app \
124+
examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
125+
/tmp/bloat_reports/
126+
rm -rf examples/lighting-app/nrfconnect/build/nrfconnect
127+
- name: Build example nRF Connect SDK Light Switch App on nRF52840 DK
128+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
83129
run: |
84-
scripts/examples/nrfconnect_example.sh ../src/test_driver native_sim -DCONFIG_ZMS=y -DCONFIG_ZMS_LOOKUP_CACHE=y -DCONFIG_ZMS_LOOKUP_CACHE_SIZE=512 -DCONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS=y -DCONFIG_NVS=n
85-
ctest --build-nocmake -V --output-on-failure --test-dir src/test_driver/nrfconnect/build/nrfconnect --no-tests=error
130+
scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk/nrf52840
131+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
132+
nrfconnect nrf52840dk_nrf52840 light-switch-app \
133+
examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
134+
/tmp/bloat_reports/
135+
rm -rf examples/light-switch-app/nrfconnect/build/nrfconnect
136+
- name: Build example nRF Connect SDK Shell on nRF52840 DK
137+
if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true' || steps.changed_paths.outputs.nrfconnect == 'true'
138+
run: |
139+
scripts/examples/nrfconnect_example.sh shell nrf52840dk/nrf52840
140+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
141+
nrfconnect nrf52840dk_nrf52840 shell \
142+
examples/shell/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
143+
/tmp/bloat_reports/
144+
rm -rf examples/shell/nrfconnect/build/nrfconnect
145+
- name: Build example nRF Connect SDK All Clusters App on nRF52840 DK
146+
run: |
147+
scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk/nrf52840
148+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
149+
nrfconnect nrf52840dk_nrf52840 all-clusters-app \
150+
examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
151+
/tmp/bloat_reports/
152+
rm -rf examples/all-clusters-app/nrfconnect/build/nrfconnect
153+
- name: Build example nRF Connect SDK All Clusters App on nRF54L15 DK
154+
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
155+
run: |
156+
scripts/examples/nrfconnect_example.sh all-clusters-app nrf54l15dk/nrf54l15/cpuapp
157+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
158+
nrfconnect nrf54l15dk_nrf54l15_cpuapp all-clusters-app \
159+
examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \
160+
/tmp/bloat_reports/
161+
rm -rf examples/all-clusters-app/nrfconnect/build/nrfconnect
162+
- name: Run unit tests for Zephyr native_posix_64 platform
163+
if: >
164+
github.event_name == 'push' ||
165+
steps.changed_paths.outputs.tests == 'true' ||
166+
steps.changed_paths.outputs.nrfconnect == 'true' ||
167+
steps.changed_paths.outputs.pigweed == 'true' ||
168+
steps.changed_paths.outputs.crypto == 'true'
169+
run: |
170+
scripts/run_in_build_env.sh "source $ZEPHYR_BASE/zephyr-env.sh && pip3 install -r scripts/setup/requirements.build.txt && ./scripts/build/build_examples.py --target nrf-native-sim-tests build"
86171
- name: Uploading Failed Test Logs
87-
uses: actions/upload-artifact@v4
172+
uses: actions/upload-artifact@v5
88173
if: ${{ failure() && !env.ACT }}
89174
with:
90175
name: test-log
91176
path: |
92-
src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log
177+
src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log
178+
179+
- name: Uploading Size Reports
180+
uses: ./.github/actions/upload-size-reports
181+
if: ${{ !env.ACT }}
182+
with:
183+
platform-name: nRFConnect
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Build example - nRF Connect SDK
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'v*-branch'
8+
pull_request:
9+
merge_group:
10+
workflow_dispatch:
11+
inputs:
12+
ncs_revision:
13+
description: "NCS branch or commit SHA"
14+
required: true
15+
default: "origin/master"
16+
17+
concurrency:
18+
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
19+
cancel-in-progress: true
20+
21+
env:
22+
CHIP_NO_LOG_TIMESTAMPS: true
23+
24+
jobs:
25+
nrfconnect:
26+
name: nRF Connect SDK
27+
28+
env:
29+
BUILD_TYPE: nrfconnect
30+
31+
runs-on: ubuntu-latest
32+
if: github.actor != 'restyled-io[bot]'
33+
34+
container:
35+
image: ghcr.io/project-chip/chip-build-nrf-platform:174
36+
volumes:
37+
- "/tmp/bloat_reports:/tmp/bloat_reports"
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v5
42+
- name: Checkout submodules & Bootstrap
43+
uses: ./.github/actions/checkout-submodules-and-bootstrap
44+
with:
45+
platform: nrfconnect
46+
- name: Cleanup unuseful directories
47+
run: |
48+
rm -rf ./.environment/cipd/packages/zap
49+
rm -rf ./.environment/cipd/packages/zap/resources
50+
rm -rf ./.environment/cipd/packages/arm/bin
51+
rm -rf ./.environment/gn_out/python-venv
52+
- name: Dump disk info
53+
uses: ./.github/actions/dump-disk-info
54+
# Workaround, in docker image there is a change in the zephyr-env.sh script that breaks the checkout process.
55+
# We need to restore the zephyr-env.sh script to the original state.
56+
# It should be fixed during the next NCS bump in the Matter upstream repository.
57+
- name: Pre-update NCS
58+
run: |
59+
cp $ZEPHYR_BASE/zephyr-env.sh $ZEPHYR_BASE/../zephyr-env.sh
60+
git -C /opt/NordicSemiconductor/nrfconnect/zephyr stash
61+
- name: Update NCS recommended version (workflow_dispatch)
62+
if: github.event_name == 'workflow_dispatch'
63+
run: |
64+
echo "Using NCS from ${{ github.event.inputs.ncs_revision }}"
65+
echo "${{ github.event.inputs.ncs_revision }}" > config/nrfconnect/.nrfconnect-recommended-revision
66+
- name: Update NCS recommended version (pull_request)
67+
if: github.event_name == 'pull_request'
68+
env:
69+
PR_DESCRIPTION: "${{ github.event.pull_request.body }}"
70+
run: |
71+
if [ -n "$PR_DESCRIPTION" ]; then
72+
NCS_PR_ID=$(echo $PR_DESCRIPTION | { grep 'NCS PR' || true; } | sed 's/.*nrfconnect\/sdk-nrf//' | { grep -oE '[0-9]+' || true; })
73+
if [ -n "$NCS_PR_ID" ]; then
74+
echo "Using NCS from pull/$NCS_PR_ID/head"
75+
git -C $ZEPHYR_BASE/../nrf fetch origin pull/$NCS_PR_ID/head:NCS_PR
76+
echo NCS_PR > config/nrfconnect/.nrfconnect-recommended-revision
77+
else
78+
echo "Using NCS from $(cat config/nrfconnect/.nrfconnect-recommended-revision)"
79+
fi
80+
fi
81+
- name: Check nRF Connect SDK revision.
82+
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --update --shallow"
83+
continue-on-error: true
84+
- name: Dump disk info
85+
uses: ./.github/actions/dump-disk-info
86+
- name: Run unit tests of factory data generation script
87+
run: |
88+
scripts/run_in_build_env.sh 'source $ZEPHYR_BASE/../zephyr-env.sh && pip3 install -r scripts/setup/requirements.nrfconnect.txt'
89+
scripts/run_in_build_env.sh 'source $ZEPHYR_BASE/../zephyr-env.sh && ./scripts/tools/nrfconnect/tests/test_generate_factory_data.py'
90+
- name: Cleanup build directory
91+
run: rm -rf ./out/nrf-native-sim-tests
92+
- name: Run unit tests for Zephyr native_posix_64 platform with NVS
93+
run: |
94+
scripts/run_in_build_env.sh 'source $ZEPHYR_BASE/../zephyr-env.sh && ./scripts/build/build_examples.py --target nrf-native-sim-tests build'
95+
- name: Run unit tests for Zephyr native_posix_64 platform with ZMS
96+
run: |
97+
scripts/run_in_build_env.sh "source $ZEPHYR_BASE/../zephyr-env.sh && scripts/examples/nrfconnect_example.sh ../src/test_driver native_sim -DCONFIG_ZMS=y -DCONFIG_ZMS_LOOKUP_CACHE=y -DCONFIG_ZMS_LOOKUP_CACHE_SIZE=512 -DCONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS=y -DCONFIG_NVS=n"
98+
ctest --build-nocmake -V --output-on-failure --test-dir src/test_driver/nrfconnect/build/nrfconnect --no-tests=error
99+
- name: Uploading Failed Test Logs
100+
uses: actions/upload-artifact@v4
101+
if: ${{ failure() && !env.ACT }}
102+
with:
103+
name: test-log
104+
path: |
105+
src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log

third_party/pigweed/repo

Submodule repo updated from abf1641 to abf0521

0 commit comments

Comments
 (0)