diff --git a/Jenkinsfile b/Jenkinsfile index a1b4080b47eb87..e4101c8253b3ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,7 +98,7 @@ def bootstrapWorkspace() } } -def buildOpenThreadExamples() +def buildOpenThreadExample(String name, String board) { actionWithRetry { node(buildFarmLabel) @@ -113,7 +113,7 @@ def buildOpenThreadExamples() // CSA Examples build withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) { - sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py' + sh "python3 ./silabs_ci_scripts/build_openthread_csa_examples.py \"${name}\" \"${board}\"" } } } @@ -125,115 +125,9 @@ def buildOpenThreadExamples() } } -def buildOpenThreadLight() -{ - actionWithRetry { - node(buildFarmLabel) - { - def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - buildOverlayDir) - def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath - def saveDir = 'matter/' - dir(dirPath) { - withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root") - { - // CSA Examples build - withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) - { - sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py lighting-app' - } - } - } - deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - workspaceTmpDir, - 'matter/out/', - '-name "*.s37" -o -name "*.map"') - } - } -} -def buildOpenThreadLock() -{ - actionWithRetry { - node(buildFarmLabel) - { - def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - buildOverlayDir) - def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath - def saveDir = 'matter/' - dir(dirPath) { - withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root") - { - // CSA Examples build - withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) - { - sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py lock-app' - } - } - } - deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - workspaceTmpDir, - 'matter/out/', - '-name "*.s37" -o -name "*.map"') - } - } -} -def buildOpenThreadSwitch() -{ - actionWithRetry { - node(buildFarmLabel) - { - def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - buildOverlayDir) - def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath - def saveDir = 'matter/' - dir(dirPath) { - withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root") - { - // CSA Examples build - withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) - { - sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py light-switch-app' - } - } - } - deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - workspaceTmpDir, - 'matter/out/', - '-name "*.s37" -o -name "*.map"') - } - } -} - -def buildOpenThreadWindow() -{ - actionWithRetry { - node(buildFarmLabel) - { - def workspaceTmpDir = createWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - buildOverlayDir) - def dirPath = workspaceTmpDir + createWorkspaceOverlay.overlayMatterPath - def saveDir = 'matter/' - dir(dirPath) { - withDockerContainer(image: "connectedhomeip/chip-build-efr32:0.5.64", args: "-u root") - { - // CSA Examples build - withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) - { - sh 'python3 ./silabs_ci_scripts/build_openthread_csa_examples.py window-app' - } - } - } - deactivateWorkspaceOverlay(advanceStageMarker.getBuildStagesList(), - workspaceTmpDir, - 'matter/', - '-name "*.s37" -o -name "*.map"') - } - } -} - -def buildSilabsCustomOpenThreadExamples() +def buildSilabsCustomOpenThreadExamples(String board) { actionWithRetry { node(buildFarmLabel) @@ -248,7 +142,10 @@ def buildSilabsCustomOpenThreadExamples() // Custom Silabs build withEnv(['PW_ENVIRONMENT_ROOT='+dirPath]) { - sh 'python3 ./silabs_ci_scripts/build_custom_examples.py' + sh "echo ${board}" + sh "echo $board" + sh "echo \"${board}\"" + sh "python3 ./silabs_ci_scripts/build_custom_examples.py \"${board}\"" } } } @@ -285,7 +182,6 @@ def buildWiFiLighting() '-name "*.s37" -o -name "*.map"') } } - } def buildWiFiLock() @@ -465,17 +361,44 @@ def pipeline() def parallelNodes = [:] // Docker container solution - parallelNodes['Build OpenThread Lighting'] = { this.buildOpenThreadLight() } - parallelNodes['Build OpenThread Lock'] = { this.buildOpenThreadLock() } - parallelNodes['Build OpenThread Light switch'] = { this.buildOpenThreadSwitch() } - parallelNodes['Build OpenThread Window'] = { this.buildOpenThreadWindow() } + parallelNodes['Build OpenThread Lighting BRD4161A'] = { this.buildOpenThreadExample("lighting-app", "BRD4161A") } + parallelNodes['Build OpenThread Lighting BRD4164A'] = { this.buildOpenThreadExample("lighting-app", "BRD4164A") } + parallelNodes['Build OpenThread Lighting BRD4166A'] = { this.buildOpenThreadExample("lighting-app", "BRD4166A") } + parallelNodes['Build OpenThread Lighting BRD4186A'] = { this.buildOpenThreadExample("lighting-app", "BRD4186A") } + parallelNodes['Build OpenThread Lighting BRD4187A'] = { this.buildOpenThreadExample("lighting-app", "BRD4187A") } + // Fix Me + //parallelNodes['Build OpenThread Lighting BRD4304A'] = { this.buildOpenThreadExample("lighting-app", "BRD4304A") } + + parallelNodes['Build OpenThread Lock BRD4161A'] = { this.buildOpenThreadExample("lock-app", "BRD4161A") } + parallelNodes['Build OpenThread Lock BRD4164A'] = { this.buildOpenThreadExample("lock-app", "BRD4164A") } + parallelNodes['Build OpenThread Lock BRD4166A'] = { this.buildOpenThreadExample("lock-app", "BRD4166A") } + parallelNodes['Build OpenThread Lock BRD4186A'] = { this.buildOpenThreadExample("lock-app", "BRD4186A") } + parallelNodes['Build OpenThread Lock BRD4187A'] = { this.buildOpenThreadExample("lock-app", "BRD4187A") } + // parallelNodes['Build OpenThread Lock BRD4304A'] = { this.buildOpenThreadExample("lock-app", "BRD4304A") } + + parallelNodes['Build OpenThread Light switch BRD4161A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4161A") } + parallelNodes['Build OpenThread Light switch BRD4164A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4164A") } + parallelNodes['Build OpenThread Light switch BRD4166A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4166A") } + parallelNodes['Build OpenThread Light switch BRD4186A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4186A") } + parallelNodes['Build OpenThread Light switch BRD4187A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4187A") } + // parallelNodes['Build OpenThread Light switch BRD4304A'] = { this.buildOpenThreadExample("light-switch-app", "BRD4304A") } + + parallelNodes['Build OpenThread Window BRD4161A'] = { this.buildOpenThreadExample("window-app", "BRD4161A") } + parallelNodes['Build OpenThread Window BRD4164A'] = { this.buildOpenThreadExample("window-app", "BRD4164A") } + parallelNodes['Build OpenThread Window BRD4166A'] = { this.buildOpenThreadExample("window-app", "BRD4166A") } + parallelNodes['Build OpenThread Window BRD4186A'] = { this.buildOpenThreadExample("window-app", "BRD4186A") } + parallelNodes['Build OpenThread Window BRD4187A'] = { this.buildOpenThreadExample("window-app", "BRD4187A") } + // parallelNodes['Build OpenThread Window BRD4304A'] = { this.buildOpenThreadExample("window-app", "BRD4304A") } + + parallelNodes['Build Wifi Lighting'] = { this.buildWiFiLighting() } parallelNodes['Build Wifi Lock'] = { this.buildWiFiLock() } parallelNodes['Build Chip-tool '] = { this.buildChipTool() } - parallelNodes['Build Custom Examples'] = { this.buildSilabsCustomOpenThreadExamples() } + parallelNodes['Build Custom Examples BRD4161A'] = { this.buildSilabsCustomOpenThreadExamples("BRD4161A") } + parallelNodes['Build Custom Examples BRD4186A'] = { this.buildSilabsCustomOpenThreadExamples("BRD4186A") } parallelNodes.failFast = false parallel parallelNodes diff --git a/silabs_ci_scripts/build_custom_examples.py b/silabs_ci_scripts/build_custom_examples.py index 3120caa0abd4d6..8604473e8bf8b6 100644 --- a/silabs_ci_scripts/build_custom_examples.py +++ b/silabs_ci_scripts/build_custom_examples.py @@ -6,10 +6,17 @@ import glob from pathlib import Path +if (len(sys.argv) > 1): + BOARDS = {sys.argv[1]} +else: + BOARDS = {"BRD4161A", "BRD4186A"} + +print(BOARDS) + #Defines -BOARDS = {"BRD4161A", "BRD4186A"} + BUILDS = {"OpenThread"} -BUILD_TYPES = {("standard", ""), ("release", "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"")} +BUILD_TYPES = {("standard", "")} building_command = './scripts/examples/gn_efr32_example.sh ./silabs_examples/{app}/efr32 ./out/custom/{app}/{network} {board} {buildArguments}' for examples in glob.glob("./silabs_examples/*"): diff --git a/silabs_ci_scripts/build_openthread_csa_examples.py b/silabs_ci_scripts/build_openthread_csa_examples.py index ce00783d13e183..d1523228519801 100644 --- a/silabs_ci_scripts/build_openthread_csa_examples.py +++ b/silabs_ci_scripts/build_openthread_csa_examples.py @@ -5,18 +5,36 @@ from pathlib import Path +#Defines +BUILDS = {"OpenThread"} +standard_build = ("standard", "") +release_build = ("release", + "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"") +building_command = './scripts/examples/gn_efr32_example.sh ./examples/{app}/efr32 ./out/CSA/{app}{network} {board} {buildArguments}' + + if (len(sys.argv) > 1): - APPS = sys.argv - # Remove path to the scripts - APPS.pop(0) + APPS = {sys.argv[1]} else: APPS = {"lighting-app", "lock-app", "light-switch-app", "window-app"} -#Defines -BOARDS = {"BRD4161A", "BRD4186A"} -BUILDS = {"OpenThread"} -BUILD_TYPES = {("standard", ""), ("release", "\"chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false show_qr_code=false chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true\"")} -building_command = './scripts/examples/gn_efr32_example.sh ./examples/{app}/efr32 ./out/CSA/{app}{network} {board} {buildArguments}' +if (len(sys.argv) > 2): + BOARDS = {sys.argv[2]} +else: + BOARDS = {"BRD4161A", "BRD4186A"} + +if (len(sys.argv) > 3): + if(sys.argv[3] == "standard"): + BUILD_TYPES = {standard_build} + elif(sys.argv[3] == "release"): + BUILD_TYPES = {release_build} +else: + BUILD_TYPES = {standard_build, release_build} + + +print(BUILD_TYPES) +print(BOARDS) +print(APPS) #Build everything for app_name in APPS: