Skip to content

Bump docker/login-action from 4.0.0 to 4.1.0 in the docker-actions group across 1 directory #1609

Bump docker/login-action from 4.0.0 to 4.1.0 in the docker-actions group across 1 directory

Bump docker/login-action from 4.0.0 to 4.1.0 in the docker-actions group across 1 directory #1609

Workflow file for this run

name: Pull Request
on:
pull_request:
branches:
- main
- release/*
permissions:
contents: read
defaults:
run:
shell: bash
concurrency:
group: ${{github.event.pull_request.number}}
cancel-in-progress: true
jobs:
check-packages:
name: Check Packages
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
ref: ${{github.head_ref}}
- name: Update packages
id: updates
run: bash .github/scripts/update-packages.sh
- name: Gather info
id: info
run: |
USER_NAME="github-actions[bot]"
USER_ID=$(gh api "/users/${USER_NAME}" --jq '.id')
USER_EMAIL="${USER_ID}+${USER_NAME}@users.noreply.github.com"
echo "commit-author=${USER_NAME} <${USER_EMAIL}>" >> "${GITHUB_OUTPUT}"
echo "title=Update packages for PR #${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
env:
GITHUB_TOKEN: ${{github.token}}
PR_NUMBER: ${{github.event.pull_request.number}}
- name: Push changes
uses: peter-evans/create-pull-request@v8.1.0
with:
token: ${{github.token}}
commit-message: ${{steps.info.outputs.title}}
author: ${{steps.info.outputs.commit-author}}
committer: ${{steps.info.outputs.commit-author}}
add-paths: packages/generated/install.txt
base: ${{github.event.pull_request.head.ref}}
branch: auto/update-packages/pr-${{github.event.pull_request.number}}
delete-branch: true
draft: true
title: ${{steps.info.outputs.title}}
body: ${{steps.updates.outputs.update-body}}
labels: |
dependencies
auto
check-formatting-all:
name: Check Formatting (All)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Set up EditorConfig Checker
uses: editorconfig-checker/action-editorconfig-checker@v2.2.0
- name: Check formatting
run: editorconfig-checker
check-formatting-dockerfile:
name: Check Formatting (Dockerfile)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Check formatting
uses: hadolint/hadolint-action@v3.3.0
check-formatting-markdown:
name: Check Formatting (Markdown)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Check formatting
uses: davidanson/markdownlint-cli2-action@v23.0.0
with:
globs: '**/*.md'
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
needs:
- check-packages
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Determine info
id: info
run: |
PLATFORMS=(
linux/amd64
linux/arm/v7
linux/arm64
linux/ppc64le
linux/riscv64
linux/s390x
)
SAVE_IFS="$IFS"
IFS=","
PLATFORMS="${PLATFORMS[*]}"
IFS="$SAVE_IFS"
TEMP_IMAGE='ci'
echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
echo "ci-image-tag=$TEMP_IMAGE:image" >> $GITHUB_OUTPUT
echo "ci-test-image-tag=$TEMP_IMAGE:test-image" >> $GITHUB_OUTPUT
- name: Set up Docker
uses: docker/setup-docker-action@v5.0.0
with:
daemon-config: |
{ "features": { "containerd-snapshotter": true } }
- name: Set up QEMU
uses: docker/setup-qemu-action@v4.0.0
with:
platforms: ${{steps.info.outputs.platforms}}
- name: Build image
uses: docker/build-push-action@v7.0.0
with:
context: .
platforms: ${{steps.info.outputs.platforms}}
tags: ${{steps.info.outputs.ci-image-tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Build test image
uses: docker/build-push-action@v7.0.0
with:
context: ./test
build-contexts: |
ci:image=docker-image://${{steps.info.outputs.ci-image-tag}}
platforms: ${{steps.info.outputs.platforms}}
tags: ${{steps.info.outputs.ci-test-image-tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Run tests
run: >
for PLATFORM in ${PLATFORMS//,/ }; do
echo "::group::Run test ($PLATFORM)"
docker run --rm \
--platform "$PLATFORM" \
-e 'TZ=America/Toronto' \
-e 'PUID=9999' -e 'PGID=9999' -e 'SGID=10000,10001' \
"$TEST_IMAGE_TAG"
echo '::endgroup::'
done
env:
TEST_IMAGE_TAG: ${{steps.info.outputs.ci-test-image-tag}}
PLATFORMS: ${{steps.info.outputs.platforms}}
- name: Hide outdated build details comments
uses: int128/hide-comment-action@v1.54.0
with:
starts-with: <!-- build details -->
- name: Create build details comment
id: image-details
run: |
# Determine the remote image tag to compare against
echo "::group::Determine remote image tag"
VERSION=$(grep -E '^FROM ubuntu:[a-z]+-[0-9]+$' Dockerfile)
VERSION=${VERSION##*:}
STREAM=${VERSION%-*}
REMOTE_IMAGE_TAG=$REMOTE_IMAGE:$STREAM
echo "Local image: $LOCAL_IMAGE_TAG"
echo "Remote image: $REMOTE_IMAGE_TAG"
echo "Platforms: $PLATFORMS"
if ! docker buildx imagetools inspect \
$REMOTE_IMAGE_TAG > /dev/null 2>&1; then
echo "::warning::Tag '$STREAM' not found, falling back to 'latest'"
REMOTE_IMAGE_TAG=$REMOTE_IMAGE:latest
echo "Remote image: $REMOTE_IMAGE_TAG"
fi
echo "::endgroup::"
# Build the comment body per platform
BODY=$'<!-- build details -->\n\n'
HAVE_REMOTE=true
FAILED_PLATFORMS=()
TOTAL_SIZE_NEW=0
TOTAL_SIZE_OLD=0
PLATFORM_BODIES=""
FMT='--to=iec --suffix=B --format=%.2f'
for PLATFORM in ${PLATFORMS//,/ }; do
echo "::group::$PLATFORM"
PULL_FAILED=false
# Local image size
SIZE_NEW=$(docker image inspect --platform=$PLATFORM \
-f '{{.Size}}' $LOCAL_IMAGE_TAG)
echo "Local size: $SIZE_NEW ($(echo $SIZE_NEW | numfmt $FMT))"
# Layer breakdown
DETAILS=$(
docker image history --platform=$PLATFORM \
--format 'table | {{.Size}} | {{.CreatedBy}} |' $LOCAL_IMAGE_TAG
)
DETAILS=${DETAILS#*$'\n'}
echo "Layer breakdown:"
echo "$DETAILS"
# Remote image size
if docker pull --platform=$PLATFORM $REMOTE_IMAGE_TAG; then
SIZE_OLD=$(
docker image inspect --platform=$PLATFORM -f '{{.Size}}' \
$REMOTE_IMAGE_TAG
)
echo "Remote size: $SIZE_OLD ($(echo $SIZE_OLD | numfmt $FMT))"
else
HAVE_REMOTE=false
FAILED_PLATFORMS+=("$PLATFORM")
PULL_FAILED=true
SIZE_OLD=$SIZE_NEW
echo "::warning::Failed to pull remote image for $PLATFORM," \
"using local as baseline"
fi
# Format size with difference
SIZE=$(echo $SIZE_NEW | numfmt $FMT)
DIFF=$(( SIZE_NEW - SIZE_OLD ))
echo "Difference: $DIFF bytes"
if (( DIFF > 0 )); then
SIZE+=" \`+$(echo $DIFF | numfmt $FMT)\`"
elif (( DIFF < 0 )); then
SIZE+=" \`$(echo $DIFF | numfmt $FMT)\`"
fi
echo "Formatted size: $SIZE"
# Accumulate totals
TOTAL_SIZE_NEW=$((TOTAL_SIZE_NEW + SIZE_NEW))
TOTAL_SIZE_OLD=$((TOTAL_SIZE_OLD + SIZE_OLD))
# Determine status indicator
if (( DIFF > 0 )); then
STATUS=":red_square:"
elif (( DIFF < 0 )); then
STATUS=":yellow_square:"
else
STATUS=":green_square:"
fi
# Append to platform bodies
PLATFORM_BODIES+=$'<details>\n'
PLATFORM_BODIES+="<summary><code>$PLATFORM</code>"
PLATFORM_BODIES+=" $STATUS</summary><br/>"$'\n\n'
if [[ "$PULL_FAILED" == "true" ]]; then
PLATFORM_BODIES+=$'> [!NOTE]\n'
PLATFORM_BODIES+=$'> Remote image unavailable.'
PLATFORM_BODIES+=$' Size comparison skipped'
PLATFORM_BODIES+=$' for this platform.\n\n'
fi
PLATFORM_BODIES+="**Size:** $SIZE"$'\n'
PLATFORM_BODIES+=$'\n#### Layers\n\n'
PLATFORM_BODIES+=$'| Size | Created By |\n'
PLATFORM_BODIES+=$'| ---- | ---------- |\n'
PLATFORM_BODIES+="$DETAILS"
PLATFORM_BODIES+=$'\n\n</details>\n\n'
echo "::endgroup::"
done
# Overall size summary
OVERALL_SIZE=$(echo $TOTAL_SIZE_NEW | numfmt $FMT)
OVERALL_DIFF=$((TOTAL_SIZE_NEW - TOTAL_SIZE_OLD))
if (( OVERALL_DIFF > 0 )); then
OVERALL_SIZE+=" \`+$(echo $OVERALL_DIFF | numfmt $FMT)\`"
elif (( OVERALL_DIFF < 0 )); then
OVERALL_SIZE+=" \`$(echo $OVERALL_DIFF | numfmt $FMT)\`"
fi
BODY+=$'## Build Details\n\n'
if [[ "$HAVE_REMOTE" != "true" ]]; then
BODY+=$'> [!WARNING]\n'
BODY+=$'> Size comparison may be inaccurate.'
BODY+=$' Failed to pull remote image for the following platforms:\n'
for FP in "${FAILED_PLATFORMS[@]}"; do
BODY+="> * \`$FP\`"$'\n'
done
BODY+=$'\n'
fi
BODY+="**Size:** $OVERALL_SIZE"$'\n'
BODY+=$'\n### Platforms\n\n'
BODY+="$PLATFORM_BODIES"
echo "::group::Report final image details"
docker image ls --tree 2>/dev/null
echo "::endgroup::"
gh pr comment "$PULL_REQUEST_NUMBER" --body "$BODY"
env:
REMOTE_IMAGE: ghcr.io/${{github.repository_owner}}/base-ubuntu
LOCAL_IMAGE_TAG: ${{steps.info.outputs.ci-image-tag}}
PLATFORMS: ${{steps.info.outputs.platforms}}
PULL_REQUEST_NUMBER: ${{github.event.pull_request.number}}
GITHUB_TOKEN: ${{github.token}}
label:
name: Label
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: write
steps:
- name: Apply labels
uses: actions/labeler@v6.0.1