Skip to content

Commit

Permalink
ci(docker-build): add image info to job summary
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Aug 31, 2023
1 parent 7bdc80c commit d82f1ea
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/docker/layer-99.00-summary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
#
# .github/docker/layer-99.00-summary.sh
#

set -o pipefail

# this path from for the container
# shellcheck disable=SC1091
. /.github/docker/include

main() {
layer_begin "$@"

printf "OS Info:\n"
tail -n 1000 /etc/os-release /etc/debian_version | paste /dev/null -
printf "\n"

printf "Collecting apt installed packages:\n"
echo Running: apt list \> /root/apt-pkgs-end.txt
apt list >/root/apt-pkgs-end.txt
printf "\n"

printf "Show apt package diff:\n"
echo Running: diff -uNr /root/apt-pkgs-{start,end}.txt
diff -uNr /root/apt-pkgs-{start,end}.txt
printf "\n"

printf "Show cargo packages:\n"
echo Running cargo install --list
cargo install --list | paste /dev/null -
printf "\n"

printf "Show golang packages:\n"
echo Running ls "$(go env GOPATH)/bin"
# shellcheck disable=SC2012
ls "$(go env GOPATH)/bin/" | paste /dev/null -
printf "\n"

printf "Show npm packages:\n"
echo Running npm list --global
npm list --global | paste /dev/null -
printf "\n"

layer_end "$@"
}

main "${@}" |& tee /root/layer-15.00-exercism-rust.log

if [[ -n ${GITHUB_STEP_SUMMARY} ]]; then
printf "\`\`\`text\n"
cat /root/layer-15.00-exercism-rust.log
printf "\`\`\`\n"
fi >>"${GITHUB_STEP_SUMMARY}"
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh ci-generic-debian

RUN .github/docker/layer-15.00-exercism-rust.sh ci-generic-debian

RUN .github/docker/layer-99.00-summary.sh ci-generic-debian

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY .github/docker/entrypoint.sh /entrypoint.sh

Expand Down

0 comments on commit d82f1ea

Please sign in to comment.