Skip to content

Commit 985ac55

Browse files
thst-nordicmbolivar-nordic
authored andcommitted
[nrf noup] Jenkinsfile: Build PR only on nRF platform
PR should be only build on nRF platform to save a time. Master and other branch are tested in default configuration. Signed-off-by: Kamil Gawor <[email protected]> Signed-off-by: Thomas Stilwell <[email protected]> (cherry picked from commit 71b8027) Signed-off-by: Martí Bolívar <[email protected]>
1 parent 22e7108 commit 985ac55

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Jenkinsfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pipeline {
1313
booleanParam(name: 'RUN_DOWNSTREAM', description: 'if false skip downstream jobs', defaultValue: true)
1414
booleanParam(name: 'RUN_TESTS', description: 'if false skip testing', defaultValue: true)
1515
booleanParam(name: 'RUN_BUILD', description: 'if false skip building', defaultValue: true)
16+
string(name: 'PLATFORMS', description: 'Default Platforms to test', defaultValue: 'nrf9160_pca10090 nrf52_pca10040 nrf52840_pca10056')
1617
string(name: 'jsonstr_CI_STATE', description: 'Default State if no upstream job',
1718
defaultValue: INPUT_STATE)
1819
}
@@ -105,9 +106,25 @@ pipeline {
105106
}
106107
}
107108
}
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+
}
108125
stage('Sanitycheck (all)') {
109-
when { expression { CI_STATE.ZEPHYR.RUN_BUILD } }
110-
steps {
126+
when { expression { CI_STATE.ZEPHYR.RUN_BUILD && (CI_STATE.ORIGIN.BUILD_TYPE != 'PR') } }
127+
steps { script {
111128
dir('zephyr') {
112129
sh "ls -alh "
113130
sh "echo variant: $ZEPHYR_TOOLCHAIN_VARIANT"
@@ -118,7 +135,7 @@ pipeline {
118135
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY) || \
119136
(sleep 10; ./scripts/sanitycheck $SANITYCHECK_OPTIONS $SANITYCHECK_RETRY_2))"
120137
}
121-
}
138+
} }
122139
}
123140

124141
stage('Trigger testing build') {

0 commit comments

Comments
 (0)