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, the Kconfig checks (Kconfig, KconfigBasic and
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

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: Carles Cufi <[email protected]>
(cherry picked from commit 6b01431)
(cherry picked from commit d68a96e)
  • Loading branch information
carlescufi authored and jfischer-no committed Mar 8, 2024
1 parent 0643f1e commit 4cf7a19
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/commit-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Commit tags

on: pull_request

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: Install python dependencies
run: |
pip3 install setuptools
pip3 install wheel
pip3 install gitlint
- name: Run the commit tags
uses: nrfconnect/action-commit-tags@main
with:
target: '.'
baserev: origin/${{ github.base_ref }}
revrange: 'none'
8 changes: 4 additions & 4 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,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)
git rebase origin/${BASE_REF}
# debug
git log --pretty=oneline | head -n 10
Expand All @@ -57,8 +57,8 @@ jobs:
# debug
ls -la
git log --pretty=oneline | head -n 10
./scripts/ci/check_compliance.py --annotate -e KconfigBasic \
-c origin/${BASE_REF}..
./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e Kconfig \
-e KconfigBasicNoModules -e ModulesMaintainers -c origin/${BASE_REF}..
- name: upload-results
uses: actions/upload-artifact@v3
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 4cf7a19

Please sign in to comment.