Skip to content

Commit 4e1b7ab

Browse files
committed
ci: adding yamllint action
New yamllint workflow to verify the test-spec.yml is valid Signed-off-by: Sebastian Wezel <[email protected]>
1 parent ab19d87 commit 4e1b7ab

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/workflows/lint-yaml.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Lint yaml files
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- '.github/test-spec.yml'
8+
9+
jobs:
10+
lint_yml:
11+
runs-on: ubuntu-latest
12+
name: Execute yamllint
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
- name: yaml-lint
16+
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
17+
with:
18+
file_or_dir: .github/test-spec.yml
19+
strict: false # Don't fail for warnings
20+
config_data: |
21+
extends: default
22+
ignore: |
23+
*.md
24+
CODEOWNERS
25+
*.ini
26+
# Ignoring most of the fromat related rules.
27+
rules:
28+
colons: disable
29+
comments: disable
30+
comments-indentation: disable
31+
document-start: disable
32+
line-length: disable
33+
new-line-at-end-of-file: disable
34+
indentation: disable
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2025, Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Twister Unity Tests
5+
6+
on:
7+
pull_request:
8+
types: [push, opened, reopened, synchronize]
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
twister_job:
14+
name: Run Twister patch series (PR)
15+
runs-on:
16+
- runs-on=${{ github.run_id }}
17+
- runner=4cpu-linux-x64
18+
# Keep aligned with target NCS version
19+
container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v2.9.1
20+
defaults:
21+
run:
22+
# Bash shell is needed to set toolchain related environment variables in docker container
23+
# It is a workaround for GitHub Actions limitation https://github.com/actions/runner/issues/1964
24+
shell: bash
25+
26+
steps:
27+
- name: Checkout the code
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
with:
30+
path: nrf-lite
31+
fetch-depth: 0
32+
33+
- name: restore-cache-sdk
34+
id: cache-sdk
35+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
36+
with:
37+
path: |
38+
nrf
39+
zephyr
40+
modules
41+
key: ${{ runner.os }}-nrf-sdk
42+
43+
- name: Prepare west project
44+
run: |
45+
west init -l nrf-lite
46+
west update -o=--depth=1 -n
47+
48+
- name: Install requirements
49+
run: |
50+
apt-get update
51+
apt-get install -y build-essential ninja-build gcc-multilib g++-multilib ruby
52+
53+
- name: Run Twister
54+
working-directory: nrf-lite
55+
run: |
56+
west twister -vc -p native_sim -T tests --enable-asan --enable-lsan --enable-ubsan
57+
58+
- name: upload-logs
59+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
60+
if: ${{ !cancelled() }}
61+
with:
62+
name: twister-logs
63+
path: nrf-lite/twister-out/**/*.log
64+
retention-days: 5
65+
66+
- name: save-cache-sdk
67+
if: always() && steps.cache-sdk.outputs.cache-hit != 'true'
68+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
69+
with:
70+
path: |
71+
nrf
72+
zephyr
73+
modules
74+
key: ${{ steps.cache-sdk.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)