Skip to content

Commit ae0778f

Browse files
thst-nordicmbolivar-nordic
authored andcommitted
[nrf noup] ci: adding parallel sanitycheck steps
only 1 of the parallel stages is run Signed-off-by: Thomas Stilwell <[email protected]> (cherry picked from commit ec52cc7) Signed-off-by: Martí Bolívar <[email protected]>
1 parent 985ac55 commit ae0778f

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

Jenkinsfile

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ pipeline {
4242
// ENVs for sanitycheck
4343
ARCH = "-a arm"
4444
SANITYCHECK_OPTIONS = "--inline-logs --enable-coverage -N"
45-
SANITYCHECK_RETRY = "--only-failed --outdir=out-2nd-pass"
46-
SANITYCHECK_RETRY_2 = "--only-failed --outdir=out-3rd-pass"
45+
SANITYCHECK_RETRY_CMDS = """
46+
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS --only-failed --outdir=out-2nd-pass) ||
47+
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS --only-failed --outdir=out-3rd-pass))
48+
"""
4749

4850
// ENVs for building (triggered by sanitycheck)
4951
ZEPHYR_TOOLCHAIN_VARIANT = 'zephyr'
@@ -106,36 +108,29 @@ pipeline {
106108
}
107109
}
108110
}
109-
stage('Sanitycheck (nRF)') {
110-
when { expression { CI_STATE.ZEPHYR.RUN_BUILD && (CI_STATE.ORIGIN.BUILD_TYPE == 'PR') } }
111-
steps { script {
112-
dir('zephyr') {
113-
sh "ls -alh "
114-
sh "echo variant: $ZEPHYR_TOOLCHAIN_VARIANT"
115-
sh "echo SDK dir: $ZEPHYR_SDK_INSTALL_DIR"
116-
sh "cat /opt/zephyr-sdk/sdk_version"
117-
def PLATFORM_ARGS = lib_Main.getPlatformArgs(CI_STATE.ZEPHYR.PLATFORMS)
118-
sh "source zephyr-env.sh && \
119-
(./scripts/sanitycheck $SANITYCHECK_OPTIONS $ARCH $PLATFORM_ARGS || \
120-
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY) || \
121-
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY_2))"
122-
}
123-
}}
124-
}
125-
stage('Sanitycheck (all)') {
126-
when { expression { CI_STATE.ZEPHYR.RUN_BUILD && (CI_STATE.ORIGIN.BUILD_TYPE != 'PR') } }
127-
steps { script {
128-
dir('zephyr') {
129-
sh "ls -alh "
130-
sh "echo variant: $ZEPHYR_TOOLCHAIN_VARIANT"
131-
sh "echo SDK dir: $ZEPHYR_SDK_INSTALL_DIR"
132-
sh "cat /opt/zephyr-sdk/sdk_version"
133-
sh "source zephyr-env.sh && \
134-
(./scripts/sanitycheck $SANITYCHECK_OPTIONS $ARCH || \
135-
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY) || \
136-
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY_2))"
111+
stage('Sanitycheck') {
112+
when { expression { CI_STATE.ZEPHYR.RUN_BUILD } }
113+
parallel {
114+
stage('nRF Platforms') {
115+
when { expression { CI_STATE.ORIGIN.BUILD_TYPE == 'PR' } }
116+
steps { script {
117+
dir('zephyr') {
118+
def PLATFORM_ARGS = lib_Main.getPlatformArgs(CI_STATE.ZEPHYR.PLATFORMS)
119+
sh "source zephyr-env.sh && \
120+
(./scripts/sanitycheck $SANITYCHECK_OPTIONS $ARCH $PLATFORM_ARGS || $SANITYCHECK_RETRY_CMDS"
121+
}
122+
}}
137123
}
138-
} }
124+
stage('All Platforms') {
125+
when { expression { CI_STATE.ORIGIN.BUILD_TYPE != 'PR' } }
126+
steps { script {
127+
dir('zephyr') {
128+
sh "source zephyr-env.sh && \
129+
(./scripts/sanitycheck $SANITYCHECK_OPTIONS $ARCH || $SANITYCHECK_RETRY_CMDS"
130+
}
131+
}
132+
}}
133+
}
139134
}
140135

141136
stage('Trigger testing build') {

0 commit comments

Comments
 (0)