Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions ci/upload_job_result_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,21 @@ fi

# Finds a matching file in the root and copies it to the artifact directory.
find_and_copy_job_artifact_from() {
filename="$1"
root="$2"
filepath="$(find "$root" -name "$filename" -print -quit)"
if [[ -z "$filepath" ]]; then
echo "$filename does not exist in repo directory."
root="$1"
name="$2"
if find "$root"/ -maxdepth 4 -name "$name" -type f -printf '' -quit 2>/dev/null; then
find "$root"/ -maxdepth 4 -name "$name" -type f -print0 | xargs -0 -P4 -I% cp -v % "$job_artifacts"/
else
echo "No file matching '$name' found in '$root'."
return 1
fi
cp -v "$filepath" "$job_artifacts/"
}

find_and_copy_job_artifact_from "sccache_stats.json" build/ || : # Nonfatal if not found
find_and_copy_job_artifact_from /tmp "sccache*.log" || : # Nonfatal if not found
find_and_copy_job_artifact_from build "sccache_stats.json" || : # Nonfatal if not found
find_and_copy_job_artifact_from build ".ninja_log" || : # Nonfatal if not found
find_and_copy_job_artifact_from build "build.ninja" || : # Nonfatal if not found
find_and_copy_job_artifact_from build "rules.ninja" || : # Nonfatal if not found
find_and_copy_job_artifact_from build "ctest.log" || : # Nonfatal if not found

ci/util/artifacts/upload/register.sh "zz_jobs-$job_id" "$jobs_artifact_dir"