Skip to content

Commit

Permalink
Export copy of build logs as artifact.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-mnemonic committed Jun 26, 2024
1 parent 6a8178a commit 5240cd7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/make-sandwich.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,24 @@ jobs:

- name: build
run: |
# prepare env ########################################################
BASE_DIR=$( pwd )
TOOLS_DIR="${BASE_DIR}/toolchain-autobuilds/tools"
CONFIG_DIR="${BASE_DIR}/toolchain-autobuilds/config"
PAST_BUILDS="${BASE_DIR}/past-builds"
SNAPSHOTS="${BASE_DIR}/snapshots"
T2_TEMPLATE_BASE_DIR="${BASE_DIR}/toolchain-autobuilds/config/t2"
T2_ROOT="${BASE_DIR}/t2-minimal"
export TOOLS_DIR CONFIG_DIR PAST_BUILDS SNAPSHOTS T2_TEMPLATE_BASE_DIR T2_ROOT
BUILD_LOGS="${BASE_DIR}/build-logs"
export TOOLS_DIR CONFIG_DIR PAST_BUILDS SNAPSHOTS T2_TEMPLATE_BASE_DIR T2_ROOT BUILD_LOGS
PATH=${TOOLS_DIR}:${PATH}
# run build ##########################################################
workflow.bash
# exports ############################################################
echo "BUILD_LOGS=${BUILD_LOGS}" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: build-logs
path: ${BUILD_LOGS}/
compression-level: 9
3 changes: 3 additions & 0 deletions tools/prepare-build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ cp "${_tools_dir}/perform-build.bash" "${_env_dest}/" || exit 1
# make sure the scripts are executable
chmod +x ${_env_dest}/{perform-build.bash,build-order.bash} || exit 1

# also echo build order for other tools to be able to use it
echo "${_build_order}"

exit
12 changes: 11 additions & 1 deletion tools/workflow.bash
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,22 @@ fi

# create build order
echo -n "I: creating build order... "
prepare-build.bash || exit 1
_build_order=$( prepare-build.bash ) || exit 1
echo "OK"

# perform builds
echo "I: performing build... "
sudo ${TOOLS_DIR}/exec-in-chroot.bash "$T2_ROOT" "/perform-build.bash" || exit 1
echo "OK"

if [[ ! -e ${BUILD_LOGS} ]]; then

mkdir -p ${BUILD_LOGS}
fi
_target_env_log_dir=$( echo ${T2_ROOT}/usr/src/t2-src/build/*/var/adm/logs )
for _build in ${_build_order}; do

cp ${_target_env_log_dir}/${_build}* ${BUILD_LOGS}/
done

exit

0 comments on commit 5240cd7

Please sign in to comment.