Skip to contentSkip to conversation

CI: collect certain intermediate files as artifacts (part 2)

PATCH In review Jan Beulich 2 participants 2 messages May 20 – May 21

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CI: collect certain intermediate files as artifacts (part 2)

Build issues may also surface for analysis jobs. Collect intermediate files (if any) there as well. Include xen/.config too, since it's not otherwise collected.

---
https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2536905486

automation/eclair_analysis/build.sh +12 -1
@@ -58,10 +58,21 @@ runtime_failures_docs() {
 (
   runtime_failures_docs
 
+  ret=0
+  mkdir -p intermediates
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
        "CC=${CC}"                               \
        "CXX=${CXX}"                             \
        "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
-       -C xen
+       -C xen || ret=$?
+
+  # Preserve Xen intermediate files.  Some may be there only upon build failure.
+  for f in xen/.config xen/.xen-syms.* xen/.xen.efi.*; do
+      if [[ -f $f ]]; then
+          cp $f intermediates/
+      fi
+  done
+
+  exit $ret
 )
automation/gitlab-ci/analyze.yaml +1 -0
@@ -18,6 +18,7 @@
       - "${ECLAIR_OUTPUT_DIR}/*.txt"
       - '*.log'
       - '*.json'
+      - intermediates/
     reports:
       codequality: gl-code-quality-report.json
   rules:
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jan Beulich

Build issues may also surface for analysis jobs. Collect intermediate files (if any) there as well. Include xen/.config too, since it's not otherwise collected.

Quoted 39 lines

---
https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2536905486

automation/eclair_analysis/build.sh +12 -1
@@ -58,10 +58,21 @@ runtime_failures_docs() {
 (
   runtime_failures_docs
 
+  ret=0
+  mkdir -p intermediates
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
        "CC=${CC}"                               \
        "CXX=${CXX}"                             \
        "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
-       -C xen
+       -C xen || ret=$?
+
+  # Preserve Xen intermediate files.  Some may be there only upon build failure.
+  for f in xen/.config xen/.xen-syms.* xen/.xen.efi.*; do
+      if [[ -f $f ]]; then
+          cp $f intermediates/
+      fi
+  done
+
+  exit $ret
 )
automation/gitlab-ci/analyze.yaml +1 -0
@@ -18,6 +18,7 @@
       - "${ECLAIR_OUTPUT_DIR}/*.txt"
       - '*.log'
       - '*.json'
+      - intermediates/
     reports:
       codequality: gl-code-quality-report.json
   rules: