-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ env: | |
jobs: | ||
build: | ||
name: "Build: ${{ matrix.version }}/${{ matrix.arch }}" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
fail-fast: false # Don't cancel other jobs if one fails | ||
|
@@ -59,7 +59,7 @@ jobs: | |
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
|
@@ -70,18 +70,18 @@ jobs: | |
echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Check Docker | ||
run: | | ||
docker version | ||
docker info | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
@@ -91,7 +91,7 @@ jobs: | |
- | ||
# Build and cache image in the registry | ||
name: Build image | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ env.BUILD_DIR }} | ||
file: ${{ env.BUILD_DIR }}/Dockerfile | ||
|
@@ -103,13 +103,22 @@ jobs: | |
# Push intermediate arch-specific build tag to repo | ||
tags: ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-${{ env.ARCH }} | ||
push: ${{ github.event_name != 'pull_request' }} # Don't push for PRs | ||
# Disable automatic image attestations | ||
# With image attestations enabled, the image tag pushed to the registry is a manifest list. | ||
# That makes it impossible to stitch different platform images together in a manifest list, since you | ||
# cannot have a manifest list of manifest lists. | ||
# See https://docs.docker.com/build/attestations/attestation-storage/ | ||
# TODO: Refactor to allow for image attestations | ||
provenance: false | ||
sbom: false | ||
# BUILD_IMAGE_TAG - persistent multi-arch tag, updated at the end of the build (success or failure) | ||
cache-from: type=registry,ref=${{ env.BUILD_IMAGE_TAG }} | ||
cache-to: type=inline # Write the cache metadata into the image configuration | ||
# Use registry cache with max mode to cahce all image layers in the registry | ||
cache-from: type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }} | ||
cache-to: type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }},mode=max | ||
|
||
test: | ||
name: "Test: ${{ matrix.version }}/${{ matrix.arch }}" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
|
||
strategy: | ||
|
@@ -134,12 +143,10 @@ jobs: | |
steps: | ||
- | ||
name: Setup Bats | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: "1.3.0" | ||
uses: bats-core/[email protected] | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
|
@@ -181,14 +188,16 @@ jobs: | |
# Dynamic variable names cannot be used when mapping step outputs to job outputs. | ||
# Step outputs cannot be accessed directly from other jobs. Dead end. | ||
- name: Store test results | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
name: test-results-${{ env.GIT_SHA7 }}-${{ env.VERSION_PREFIX }}${{ env.VERSION }}-${{ env.ARCH }} | ||
path: ${{ github.workspace }}/test-results-*.txt | ||
if-no-files-found: error | ||
overwrite: true | ||
|
||
push: | ||
name: "Push: ${{ matrix.version }}/multi" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
# Wait for test to either succeed or fail | ||
needs: test | ||
|
@@ -208,7 +217,7 @@ jobs: | |
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Environment variables | ||
run: | | ||
|
@@ -220,15 +229,16 @@ jobs: | |
- | ||
# Login to Docker Hub | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Retrieve test results | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: test-results | ||
pattern: test-results-${{ env.GIT_SHA7 }}-* | ||
merge-multiple: true | ||
- | ||
# Generate persistent tags (edge, stable, release) | ||
name: Docker image tags | ||
|
@@ -265,5 +275,5 @@ jobs: | |
docker manifest push ${tag} | ||
done | ||
# Clean up intermediate arch-specific image tags (DockerHub only) | ||
.github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64 | ||
.github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64 | ||
.github/scripts/docker-tag-delete.sh "${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64" | ||
.github/scripts/docker-tag-delete.sh "${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64" |