Skip to content

Commit 589925c

Browse files
authored
Update github actions to deal with deprecated machine images and update test infrastructure. (#26)
* Update github actions to deal with deprecated machine images and update testr infrastructure. * Removed debug.
1 parent 46f7a81 commit 589925c

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

.github/workflows/docker-build.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-24.04
2020
steps:
2121
- uses: actions/checkout@v3
2222
with:
@@ -26,7 +26,7 @@ jobs:
2626
run: make images
2727
scan:
2828
needs: [ "build" ]
29-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-24.04
3030
steps:
3131
- uses: actions/checkout@v3
3232
with:
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: View sarif file
7171
if: always()
72-
run: |
72+
run: |
7373
cat ${{ steps.scan.outputs.sarif }}
7474
7575
- name: Upload Anchore Scan SARIF Report
@@ -80,7 +80,7 @@ jobs:
8080
deploy:
8181
name: Push to DockerHub
8282
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'pegasystems/k8s-wait-for' }}
83-
runs-on: ubuntu-latest
83+
runs-on: ubuntu-24.04
8484
needs: [scan, test]
8585
steps:
8686
- name: Login to Docker Hub
@@ -95,7 +95,7 @@ jobs:
9595

9696
test:
9797
name: Container Tests
98-
runs-on: ubuntu-latest
98+
runs-on: ubuntu-24.04
9999
if: always()
100100
needs: [build, scan]
101101
env:
@@ -133,19 +133,41 @@ jobs:
133133
curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64
134134
chmod +x container-structure-test-linux-amd64
135135
sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
136-
136+
137137
- name: Install prerequisites
138138
run: |
139+
docker save -o k8s-wait-for-test pegasystems/k8s-wait-for:test
140+
139141
curl -o bash_unit "https://raw.githubusercontent.com/pgrange/bash_unit/master/bash_unit"
140142
chmod +x bash_unit
141-
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
142-
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.28.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
143+
144+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
145+
146+
sudo apt-get update
147+
sudo apt-get install ca-certificates curl
148+
sudo install -m 0755 -d /etc/apt/keyrings
149+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
150+
sudo chmod a+r /etc/apt/keyrings/docker.asc
151+
152+
echo \
153+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
154+
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
155+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
156+
sudo apt-get update
157+
158+
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
159+
160+
curl -Lo kubectl https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl
161+
chmod +x kubectl
162+
sudo cp kubectl /usr/local/bin
163+
164+
curl -Lo minikube https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64 && install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
143165
mkdir -p $HOME/.kube $HOME/.minikube
144166
touch $KUBECONFIG
145167
sudo apt-get install -y conntrack
146-
minikube start --vm-driver=none --kubernetes-version=v1.23.15
168+
minikube start --vm-driver=docker --kubernetes-version=v1.31.0
147169
echo "minikube startup complete."
148-
docker save -o k8s-wait-for-test pegasystems/k8s-wait-for:test
170+
149171
minikube image load k8s-wait-for-test
150172
echo "Sleeping for 10s..."
151173
sleep 10

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.21 AS builder
1+
FROM alpine:3.22 AS builder
22

33
ARG TARGETARCH
44

@@ -9,7 +9,7 @@ RUN apk add --update --no-cache ca-certificates curl jq \
99
&& ls -al /usr/local/bin/kubectl \
1010
&& chmod +x /usr/local/bin/kubectl
1111

12-
FROM alpine:3.21
12+
FROM alpine:3.22
1313
ARG VCS_REF
1414
ARG BUILD_DATE
1515

0 commit comments

Comments
 (0)