Skip to content

Commit 5bf4b9d

Browse files
authored
Fix/GitHub wf updates (#129)
* upgrade actions version * Upgrade Curl version in testsuite * Free Disk Space * remove deprecated token parameter
1 parent a6f0538 commit 5bf4b9d

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

.github/workflows/docker-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
image-variant: [prd,dev]
1616

17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-22.04
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
2323
uses: FranzDiebold/github-env-vars-action@v2
2424

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

@@ -47,7 +47,7 @@ jobs:
4747
uses: docker/setup-buildx-action@v3
4848

4949
- name: Cache Docker layers
50-
uses: actions/cache@v3
50+
uses: actions/cache@v4
5151
with:
5252
path: /tmp/.buildx-cache
5353
key: ${{ runner.os }}-buildx-${{ github.sha }}
@@ -60,7 +60,7 @@ jobs:
6060
6161
- name: Build "${{ steps.prep.outputs.docker-image-name }}" Docker Image
6262
id: build
63-
uses: docker/build-push-action@v5
63+
uses: docker/build-push-action@v6
6464
with:
6565
builder: ${{ steps.buildx.outputs.name }}
6666
context: .

.github/workflows/docker-release.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: FranzDiebold/github-env-vars-action@v2
3232

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

@@ -65,7 +65,7 @@ jobs:
6565
uses: docker/setup-buildx-action@v3
6666

6767
- name: Cache Docker layers
68-
uses: actions/cache@v3
68+
uses: actions/cache@v4
6969
with:
7070
path: /tmp/.buildx-cache
7171
key: ${{ runner.os }}-buildx-${{ github.sha }}
@@ -90,7 +90,7 @@ jobs:
9090
9191
- name: Build "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker Image
9292
id: build
93-
uses: docker/build-push-action@v5
93+
uses: docker/build-push-action@v6
9494
with:
9595
builder: ${{ steps.buildx.outputs.name }}
9696
context: .
@@ -106,7 +106,7 @@ jobs:
106106
outputs: type=docker,dest=/tmp/builded.tar
107107

108108
- name: Upload "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
109-
uses: actions/upload-artifact@v3
109+
uses: actions/upload-artifact@v4
110110
with:
111111
name: ${{ matrix.image-variant }}
112112
path: /tmp/builded.tar
@@ -137,15 +137,15 @@ jobs:
137137
chmod 777 test/demo/skeleton
138138
139139
- name: Setup BATS testing framework
140-
uses: zebby76/setup-bats@v1
140+
uses: zebby76/setup-bats@v2
141141
with:
142142
bats-version: 1.2.1
143143

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

147147
- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
148-
uses: actions/download-artifact@v3
148+
uses: actions/download-artifact@v4
149149
with:
150150
name: ${{ matrix.image-variant }}
151151
path: /tmp
@@ -156,7 +156,7 @@ jobs:
156156
docker image ls -a
157157
158158
- name: Scan "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image
159-
uses: anchore/scan-action@v3
159+
uses: anchore/scan-action@v4
160160
id: scan
161161
with:
162162
image: ${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}
@@ -178,14 +178,26 @@ jobs:
178178
env:
179179
IMAGE_VARIANT: ${{ matrix.image-variant }}
180180

181+
- name: Free Disk Space
182+
run: |
183+
echo "Disk space before post-build cleanup:"
184+
df -h
185+
sudo rm -rf /usr/local/.ghcup
186+
sudo rm -rf /opt/hostedtoolcache/CodeQL
187+
sudo rm -rf /usr/local/lib/android/sdk/ndk
188+
sudo rm -rf /usr/share/dotnet
189+
sudo apt-get clean
190+
echo "Disk space after post-build cleanup:"
191+
df -h
192+
181193
- name: Test "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker Image
182194
env:
183195
DOCKER_IMAGE_NAME: ${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}
184196
EMS_VERSION: ${{ needs.init.outputs.version-patch }}
185197
CONTAINER_ENGINE: docker
186198
run: |
187199
docker network create docker_default
188-
docker pull appropriate/curl:latest
200+
docker pull docker.io/curlimages/curl:8.1.2
189201
bats -r test/tests.bats
190202
191203
sign-dev:
@@ -200,11 +212,16 @@ jobs:
200212

201213
steps:
202214

215+
- name: Install Dependencies
216+
run: |
217+
sudo apt update
218+
sudo apt install -y notary
219+
203220
- name: Set up Docker Buildx
204221
uses: docker/setup-buildx-action@v3
205222

206223
- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
207-
uses: actions/download-artifact@v3
224+
uses: actions/download-artifact@v4
208225
with:
209226
name: ${{ matrix.image-variant }}
210227
path: /tmp
@@ -272,11 +289,16 @@ jobs:
272289

273290
steps:
274291

292+
- name: Install Dependencies
293+
run: |
294+
sudo apt update
295+
sudo apt install -y notary
296+
275297
- name: Set up Docker Buildx
276298
uses: docker/setup-buildx-action@v3
277299

278300
- name: Download "${{ needs.init.outputs.docker-image-name }}:${{ needs.init.outputs.github-ci-sha-short }}-${{ matrix.image-variant }}" Docker image artifact
279-
uses: actions/download-artifact@v3
301+
uses: actions/download-artifact@v4
280302
with:
281303
name: ${{ matrix.image-variant }}
282304
path: /tmp
@@ -389,7 +411,7 @@ jobs:
389411
runs-on: ubuntu-20.04
390412
needs: [sign-prd,sign-dev]
391413
steps:
392-
- uses: joutvhu/delete-artifact@v1
414+
- uses: geekyeggo/delete-artifact@v5
393415
with:
394-
name: |
395-
${{ matrix.image-variant }}
416+
name: ${{ matrix.image-variant }}
417+
failOnError: false

test/helpers/tests.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ docker_cleanup() {
2525
# $2 HTTP path to query
2626
# $@ additional options to pass to the curl command
2727
function curl_container {
28+
#local -r curl_image_name="docker.io/appropriate/curl:latest"
29+
#local -r curl_image_name="docker.io/curlimages/curl:7.88.1"
30+
local -r curl_image_name="docker.io/curlimages/curl:8.1.2"
31+
2832
local -r container=$1
2933
local -r path=$2
3034
shift 2
31-
${BATS_CONTAINER_ENGINE} run --rm --net=${BATS_CONTAINER_NETWORK_NAME} --label bats-type="curl" appropriate/curl --silent \
35+
${BATS_CONTAINER_ENGINE} run --rm --net=${BATS_CONTAINER_NETWORK_NAME} --label bats-type="curl" ${curl_image_name} --silent \
3236
--connect-timeout 5 \
3337
--max-time 20 \
3438
--retry 4 --retry-delay 5 \

0 commit comments

Comments
 (0)