Skip to content

Commit ab080f1

Browse files
carlescufimbolivar-nordic
authored andcommitted
[nrf noup] jenkinsfile: Multiple fixes
- In order to ensure that we use a compatible revision of ci-tools, fix the SHA of the repo to a version we know is compatible. - Use the Zephyr SDK instead of the GNU Arm Embedded toolchain. - Add retries on sanitycheck for unstable builds Signed-off-by: Carles Cufi <[email protected]> (cherry picked from commit f3c37a8) (cherry picked from commit 47aa027) Signed-off-by: Martí Bolívar <[email protected]>
1 parent 4cc4339 commit ab080f1

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

Jenkinsfile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
def IMAGE_TAG = "ncs-toolchain:1.08"
22
def REPO_CI_TOOLS = "https://github.com/zephyrproject-rtos/ci-tools.git"
3+
def REPO_CI_TOOLS_SHA = "9f4dc0be401c2b1e9b1c647513fb996bd8abd057"
34

45
pipeline {
56
agent {
@@ -25,19 +26,26 @@ pipeline {
2526

2627
// ENVs for sanitycheck
2728
ARCH = "-a arm"
28-
SANITYCHECK_OPTIONS_ALL = "--inline-logs --enable-coverage -N"
29+
SANITYCHECK_OPTIONS = "--inline-logs --enable-coverage -N"
30+
SANITYCHECK_RETRY = "--only-failed --outdir=out-2nd-pass"
31+
SANITYCHECK_RETRY_2 = "--only-failed --outdir=out-3rd-pass"
2932

3033
// ENVs for building (triggered by sanitycheck)
31-
ZEPHYR_TOOLCHAIN_VARIANT = 'gnuarmemb'
34+
ZEPHYR_TOOLCHAIN_VARIANT = 'zephyr'
3235
GNUARMEMB_TOOLCHAIN_PATH = '/workdir/gcc-arm-none-eabi-7-2018-q2-update'
36+
ZEPHYR_SDK_INSTALL_DIR = '/opt/zephyr-sdk'
3337
}
3438

3539
stages {
3640
stage('Checkout repositories') {
3741
steps {
3842
dir("ci-tools") {
3943
git branch: "master", url: "$REPO_CI_TOOLS"
44+
sh "git checkout ${REPO_CI_TOOLS_SHA}"
4045
}
46+
dir('zephyr') {
47+
sh "git rev-parse HEAD"
48+
}
4149

4250
// Initialize west
4351
sh "west init -l zephyr/"
@@ -55,8 +63,13 @@ pipeline {
5563
script {
5664
// If we're a pull request, compare the target branch against the current HEAD (the PR)
5765
if (env.CHANGE_TARGET) {
58-
COMMIT_RANGE = "origin/${env.CHANGE_TARGET}..HEAD"
59-
COMPLIANCE_ARGS = "$COMPLIANCE_ARGS $COMPLIANCE_REPORT_ARGS"
66+
COMMIT_RANGE = "origin/$CHANGE_TARGET..HEAD"
67+
COMPLIANCE_ARGS = "$COMPLIANCE_ARGS $COMPLIANCE_REPORT_ARGS"
68+
sh "echo change id: $CHANGE_ID"
69+
sh "echo git commit: $GIT_COMMIT"
70+
sh "echo commit range: $COMMIT_RANGE"
71+
sh "git rev-parse origin/$CHANGE_TARGET"
72+
sh "git rev-parse HEAD"
6073
}
6174
// If not a PR, it's a non-PR-branch or master build. Compare against the origin.
6275
else {
@@ -78,7 +91,13 @@ pipeline {
7891
stage('Sanitycheck (all)') {
7992
steps {
8093
dir('zephyr') {
81-
sh "source zephyr-env.sh && ./scripts/sanitycheck $SANITYCHECK_OPTIONS_ALL $ARCH"
94+
sh "echo variant: $ZEPHYR_TOOLCHAIN_VARIANT"
95+
sh "echo SDK dir: $ZEPHYR_SDK_INSTALL_DIR"
96+
sh "cat /opt/zephyr-sdk/sdk_version"
97+
sh "source zephyr-env.sh && \
98+
(./scripts/sanitycheck $SANITYCHECK_OPTIONS $ARCH || \
99+
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY) || \
100+
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY_2))"
82101
}
83102
}
84103
}

0 commit comments

Comments
 (0)