Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
image-variant: [prd,dev]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand All @@ -23,7 +23,7 @@ jobs:
uses: FranzDiebold/github-env-vars-action@v2

- name: Fill PHP Version Environment Variable
uses: c-py/action-dotenv-to-setenv@v4
uses: c-py/action-dotenv-to-setenv@v5
with:
env-file: .build.env

Expand All @@ -47,7 +47,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand All @@ -60,7 +60,7 @@ jobs:

- name: Build "${{ steps.prep.outputs.docker-image-name }}" Docker Image
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
Expand Down
48 changes: 35 additions & 13 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: FranzDiebold/github-env-vars-action@v2

- name: Fill PHP Version Environment Variable
uses: c-py/action-dotenv-to-setenv@v4
uses: c-py/action-dotenv-to-setenv@v5
with:
env-file: .build.env

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand All @@ -90,7 +90,7 @@ jobs:

- name: Build "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker Image
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
Expand All @@ -106,7 +106,7 @@ jobs:
outputs: type=docker,dest=/tmp/builded.tar

- name: Upload "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image-variant }}
path: /tmp/builded.tar
Expand Down Expand Up @@ -137,15 +137,15 @@ jobs:
chmod 777 test/demo/skeleton

- name: Setup BATS testing framework
uses: zebby76/setup-bats@v1
uses: zebby76/setup-bats@v2
with:
bats-version: 1.2.1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image-variant }}
path: /tmp
Expand All @@ -156,7 +156,7 @@ jobs:
docker image ls -a

- name: Scan "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image
uses: anchore/scan-action@v3
uses: anchore/scan-action@v4
id: scan
with:
image: ${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}
Expand All @@ -178,14 +178,26 @@ jobs:
env:
IMAGE_VARIANT: ${{ matrix.image-variant }}

- name: Free Disk Space
run: |
echo "Disk space before post-build cleanup:"
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/share/dotnet
sudo apt-get clean
echo "Disk space after post-build cleanup:"
df -h

- name: Test "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker Image
env:
DOCKER_IMAGE_NAME: ${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}
EMS_VERSION: ${{ needs.init.outputs.version-patch }}
CONTAINER_ENGINE: docker
run: |
docker network create docker_default
docker pull appropriate/curl:latest
docker pull docker.io/curlimages/curl:8.1.2
bats -r test/tests.bats

sign-dev:
Expand All @@ -200,11 +212,16 @@ jobs:

steps:

- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y notary

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image-variant }}
path: /tmp
Expand Down Expand Up @@ -272,11 +289,16 @@ jobs:

steps:

- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y notary

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image-variant }}
path: /tmp
Expand Down Expand Up @@ -389,7 +411,7 @@ jobs:
runs-on: ubuntu-20.04
needs: [sign-prd,sign-dev]
steps:
- uses: joutvhu/delete-artifact@v1
- uses: geekyeggo/delete-artifact@v5
with:
name: |
${{ matrix.image-variant }}
name: ${{ matrix.image-variant }}
failOnError: false
6 changes: 5 additions & 1 deletion test/helpers/tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ docker_cleanup() {
# $2 HTTP path to query
# $@ additional options to pass to the curl command
function curl_container {
#local -r curl_image_name="docker.io/appropriate/curl:latest"
#local -r curl_image_name="docker.io/curlimages/curl:7.88.1"
local -r curl_image_name="docker.io/curlimages/curl:8.1.2"

local -r container=$1
local -r path=$2
shift 2
${BATS_CONTAINER_ENGINE} run --rm --net=${BATS_CONTAINER_NETWORK_NAME} --label bats-type="curl" appropriate/curl --silent \
${BATS_CONTAINER_ENGINE} run --rm --net=${BATS_CONTAINER_NETWORK_NAME} --label bats-type="curl" ${curl_image_name} --silent \
--connect-timeout 5 \
--max-time 20 \
--retry 4 --retry-delay 5 \
Expand Down