Skip to content

Commit ad003a3

Browse files
carlescufirlubos
authored andcommitted
[nrf noup] ci: NCS-specific CI tweaks
Necessary changes for NCS CI. - Add a Jenkinsfile - Add a commit-tags workflow: This enables sauce tag checking in sdk-zephyr - compliance.yml: Disable check for merge commits, since we have upmerges downstream. Also, since in the code we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig checks ((SysBuild)Kconfig, (SysBuild)KconfigBasic and (SysBuild)KconfigBasicNoModules) will not pass so exclude them. Also, disable any maintainers-related checks - scripts/gitlint: Extend the max commit line lengths for Gitlint to account for sauce tags - Adapt to the changes in: nrfconnect/action-commit-tags#4 Signed-off-by: Carles Cufi <[email protected]> Signed-off-by: Dominik Ermel <[email protected]> Signed-off-by: Martí Bolívar <[email protected]> Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> Signed-off-by: Krishna T <[email protected]> Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit 9c80c87)
1 parent 892f60b commit ad003a3

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

.github/workflows/commit-tags.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Commit tags
2+
3+
on:
4+
pull_request:
5+
types: [synchronize, opened, reopened, edited, labeled, unlabeled,
6+
milestoned, demilestoned, assigned, unassigned, ready_for_review,
7+
review_requested]
8+
9+
jobs:
10+
commit_tags:
11+
runs-on: ubuntu-22.04
12+
name: Run commit tags checks on patch series (PR)
13+
steps:
14+
- name: Update PATH for west
15+
run: |
16+
echo "$HOME/.local/bin" >> $GITHUB_PATH
17+
18+
- name: Checkout the code
19+
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
fetch-depth: 0
23+
24+
- name: Run the commit tags
25+
uses: nrfconnect/action-commit-tags@main
26+
with:
27+
target: .
28+
upstream: zephyrproject-rtos/zephyr/main

.github/workflows/compliance.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
git config --global user.name "Your Name"
3535
git remote -v
3636
# Ensure there's no merge commits in the PR
37-
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
38-
(echo "::error ::Merge commits not allowed, rebase instead";false)
37+
#[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
38+
#(echo "::error ::Merge commits not allowed, rebase instead";false)
3939
rm -fr ".git/rebase-apply"
4040
rm -fr ".git/rebase-merge"
4141
git rebase origin/${BASE_REF}
@@ -72,12 +72,9 @@ jobs:
7272
git log --pretty=oneline | head -n 10
7373
# Increase rename limit to allow for large PRs
7474
git config diff.renameLimit 10000
75-
excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat"
76-
# The signed-off-by check for dependabot should be skipped
77-
if [ "${{ github.actor }}" == "dependabot[bot]" ]; then
78-
excludes="$excludes -e Identity"
79-
fi
80-
./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}..
75+
./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \
76+
-e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \
77+
-e ModulesMaintainers -c origin/${BASE_REF}..
8178
8279
- name: upload-results
8380
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@Library("CI_LIB") _
2+
3+
def pipeline = new ncs.sdk_zephyr.Main()
4+
5+
pipeline.run(JOB_NAME)

scripts/gitlint/zephyr_commit_rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule):
7878
name = "title-max-length-no-revert"
7979
id = "UC5"
8080
target = CommitMessageTitle
81-
options_spec = [IntOption('line-length', 75, "Max line length")]
81+
options_spec = [IntOption('line-length', 120, "Max line length")]
8282
violation_message = "Commit title exceeds max length ({0}>{1})"
8383

8484
def validate(self, line, _commit):
@@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule):
103103
name = "max-line-length-with-exceptions"
104104
id = "UC4"
105105
target = CommitMessageBody
106-
options_spec = [IntOption('line-length', 75, "Max line length")]
106+
options_spec = [IntOption('line-length', 120, "Max line length")]
107107
violation_message = "Commit message body line exceeds max length ({0}>{1})"
108108

109109
def validate(self, line, _commit):

0 commit comments

Comments
 (0)