Skip to content

Commit

Permalink
[nrf noup] ci: NCS-specific CI tweaks
Browse files Browse the repository at this point in the history
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, most Kconfig checks 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]>
Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit ef75b3e)
(cherry picked from commit 6692263)
  • Loading branch information
carlescufi authored and 57300 committed Feb 26, 2025
1 parent 0888361 commit f447d05
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/commit-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Commit tags

on:
pull_request:
types: [synchronize, opened, reopened, edited, labeled, unlabeled,
milestoned, demilestoned, assigned, unassigned, ready_for_review,
review_requested]

jobs:
commit_tags:
runs-on: ubuntu-22.04
name: Run commit tags checks on patch series (PR)
steps:
- name: Update PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Run the commit tags
uses: nrfconnect/action-commit-tags@main
with:
target: .
upstream: zephyrproject-rtos/zephyr/main
5 changes: 3 additions & 2 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
git config --global user.name "Your Name"
git remote -v
# Ensure there's no merge commits in the PR
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
(echo "::error ::Merge commits not allowed, rebase instead";false)
#[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
#(echo "::error ::Merge commits not allowed, rebase instead";false)
rm -fr ".git/rebase-apply"
rm -fr ".git/rebase-merge"
git rebase origin/${BASE_REF}
Expand Down Expand Up @@ -83,6 +83,7 @@ jobs:
# Increase rename limit to allow for large PRs
git config diff.renameLimit 10000
./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat \
-e Kconfig -e KconfigBasicNoModules -e SysbuildKconfig -e SysbuildKconfigBasicNoModules -e ModulesMaintainers \
-c origin/${BASE_REF}..
- name: upload-results
Expand Down
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@Library("CI_LIB") _

def pipeline = new ncs.sdk_zephyr.Main()

pipeline.run(JOB_NAME)
4 changes: 2 additions & 2 deletions scripts/gitlint/zephyr_commit_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule):
name = "title-max-length-no-revert"
id = "UC5"
target = CommitMessageTitle
options_spec = [IntOption('line-length', 75, "Max line length")]
options_spec = [IntOption('line-length', 120, "Max line length")]
violation_message = "Commit title exceeds max length ({0}>{1})"

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

def validate(self, line, _commit):
Expand Down

0 comments on commit f447d05

Please sign in to comment.