xmos / xcore_iot

Other
29 stars 39 forks source link

Investigate why the /branch Jenkins build always fails #476

Closed keithm-xmos closed 1 year ago

keithm-xmos commented 2 years ago

This may be because Jenkins expects a build on the "compare" branch of a PR. To test this theory, try changing the triggers in ci.yml

name: CI

on:
  push:
    branches:
      - '**'
  pull_request:
    branches:
      - 'main'
      - 'develop'
keithm-xmos commented 2 years ago

Another idea is to call https://github.com/xmos/xmos_jenkins_shared_library/blob/develop/vars/extractFromScm.txt and check the event. Only poll for artifacts if the event==pull_request. This will cause all checks for artifacts later in the pipeline to be SKIPPED.

keithm-xmos commented 2 years ago

Tried the following without any luck:

def (_, _, _, _, branch, _, _, event) = extractFromScm()
if (event=="pull_request" || branch=="main" || branch=="develop") {
    // Wait here until specified artifacts appear
    def artifactUrls = getGithubArtifactUrls([
        "bare-metal_examples",
        "freertos_core_examples",
        "freertos_aiot_examples"
        // "host_apps",
        // "rtos_tests"
    ])
}

It appears extractFromScm must be called inside a pipeline.