Skip to content

Commit 7f77c32

Browse files
karhamathst-nordic
authored andcommitted
ci: add ncs west command testing
Adding a bit more tests for ncs west commands. Signed-off-by: Kari Hamalainen <[email protected]>
1 parent ea995b3 commit 7f77c32

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

.github/workflows/west-commands.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,21 @@ on:
44
pull_request:
55
branches: [main]
66
paths:
7-
- scripts/west_commands/mypy.ini
8-
- scripts/west_commands/ncs_commands.py
9-
- scripts/west_commands/ncs_west_helpers.py
10-
- scripts/west_commands/pygit2_helpers.py
7+
- scripts/west_commands/**
8+
- scripts/requirements-west-ncs-sbom.txt
9+
- scripts/requirements-extra.txt
1110

1211
jobs:
1312
west_commands_job:
1413
runs-on: ubuntu-latest
1514
name: Run Python checks for west commands on patch series (PR)
1615
steps:
1716
- name: Checkout the code
18-
uses: actions/checkout@v3
17+
uses: nrfconnect/action-checkout-west-update@main
1918
with:
2019
path: ncs/nrf
21-
ref: ${{ github.event.pull_request.head.sha }}
22-
fetch-depth: 0
23-
- name: cache-pip
24-
uses: actions/cache@v3
25-
with:
26-
path: ~/.cache/pip
27-
key: ${{ runner.os }}-doc-pip
20+
git-ref: ${{ github.event.pull_request.head.sha }}
21+
git-fetch-depth: 0
2822
- name: Install python dependencies
2923
working-directory: ncs/nrf
3024
run: |
@@ -38,3 +32,31 @@ jobs:
3832
working-directory: ncs/nrf/scripts/west_commands
3933
run: |
4034
python3 -m mypy --config-file mypy.ini ncs_west_helpers.py pygit2_helpers.py ncs_commands.py
35+
36+
run-west-cmds:
37+
name: Run smoke tests for ncs west commands
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-latest, macos-13, windows-latest]
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- name: Checkout sources
45+
uses: nrfconnect/action-checkout-west-update@main
46+
with:
47+
git-fetch-depth: 0
48+
path: nrf
49+
- name: Install requirements
50+
shell: bash
51+
run: |
52+
pip3 install -r nrf/scripts/requirements-west-ncs-sbom.txt
53+
pip3 install -r nrf/scripts/requirements-extra.txt
54+
- name: Test ncs-sbom with asset tracker sample
55+
shell: bash
56+
run: |
57+
west ncs-sbom --input-files nrf/applications/asset_tracker_v2/**/*.c
58+
- name: Smoke test ncs-loot & ncs-compare
59+
shell: bash
60+
run: |
61+
west ncs-loot -h
62+
west ncs-compare -h

0 commit comments

Comments
 (0)