Skip to content

Commit 881713d

Browse files
committed
chore: add devel ci workflow for libs dockerfiles
1 parent 5409d37 commit 881713d

File tree

5 files changed

+219
-16
lines changed

5 files changed

+219
-16
lines changed

.github/workflows/devel.yml

Lines changed: 208 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
type=semver,pattern={{major}}.{{minor}}
6767
type=semver,pattern={{major}}
6868
type=sha
69+
type=raw,value=devel,suffix=-amd64
6970
-
7071
name: Set up Docker Buildx
7172
uses: docker/setup-buildx-action@v3
@@ -107,8 +108,6 @@ jobs:
107108
cat /etc/debian_version
108109
uname -a
109110
make test-app
110-
# make test-zlib
111-
# make test-openssl
112111
-
113112
# Temp fix
114113
# https://github.com/docker/build-push-action/issues/252
@@ -167,6 +166,7 @@ jobs:
167166
type=semver,pattern={{major}}.{{minor}}
168167
type=semver,pattern={{major}}
169168
type=sha
169+
type=raw,value=devel,suffix=-arm64
170170
-
171171
name: Set up Docker Buildx
172172
uses: docker/setup-buildx-action@v3
@@ -208,8 +208,212 @@ jobs:
208208
cat /etc/debian_version
209209
uname -a
210210
make test-app
211-
# make test-zlib
212-
# make test-openssl
211+
-
212+
# Temp fix
213+
# https://github.com/docker/build-push-action/issues/252
214+
# https://github.com/moby/buildkit/issues/1896
215+
name: Move cache
216+
run: |
217+
rm -rf /tmp/.buildx-cache
218+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
219+
220+
docker-amd64-libs:
221+
needs:
222+
- docker-amd64
223+
name: Docker test libs (amd64)
224+
runs-on: ubuntu-22.04
225+
services:
226+
registry:
227+
image: registry:2
228+
ports:
229+
- 5000:5000
230+
steps:
231+
-
232+
name: Checkout
233+
uses: actions/checkout@v4
234+
with:
235+
fetch-depth: 1
236+
# https://github.com/actions/runner-images/issues/2840
237+
- name: Free disk space
238+
run: |
239+
sudo rm -rf /opt/ghc
240+
sudo rm -rf /usr/share/dotnet
241+
sudo rm -rf /usr/local/lib/android
242+
sudo rm -rf "/usr/local/share/boost"
243+
-
244+
name: Cache Docker layers
245+
uses: actions/cache@v4
246+
with:
247+
path: /tmp/.buildx-cache
248+
key: rust-linux-darwin-builder-amd64-libs-buildx-${{ github.sha }}
249+
restore-keys: |
250+
rust-linux-darwin-builder-amd64-libs-buildx-
251+
-
252+
name: Set up QEMU
253+
uses: docker/setup-qemu-action@v3
254+
-
255+
name: Docker meta
256+
id: meta
257+
uses: docker/metadata-action@v5
258+
with:
259+
images: ${{ env.DOCKER_IMAGE }}
260+
flavor: |
261+
latest=false
262+
suffix=-amd64-libs
263+
tags: |
264+
type=schedule
265+
type=ref,event=branch
266+
type=ref,event=pr
267+
type=semver,pattern={{version}}
268+
type=semver,pattern={{major}}.{{minor}}
269+
type=semver,pattern={{major}}
270+
type=sha
271+
-
272+
name: Set up Docker Buildx
273+
uses: docker/setup-buildx-action@v3
274+
with:
275+
driver-opts: network=host
276+
-
277+
name: Build and export to Docker client
278+
uses: docker/build-push-action@v6
279+
with:
280+
context: .
281+
platforms: linux/amd64
282+
file: docker/amd64/libs/Dockerfile
283+
load: true
284+
tags: ${{ steps.meta.outputs.tags }}
285+
labels: ${{ steps.meta.outputs.labels }}
286+
build-args: |
287+
VERSION=0.0.0
288+
BASE_IMAGE=${{ env.DOCKER_IMAGE }}:devel-amd64
289+
push: ${{ github.event_name != 'pull_request' }}
290+
cache-from: type=local,src=/tmp/.buildx-cache
291+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
292+
-
293+
name: Inspect image
294+
run: |
295+
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
296+
-
297+
name: Check manifest
298+
if: github.event_name != 'pull_request'
299+
run: |
300+
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
301+
-
302+
name: Run tests
303+
uses: addnab/docker-run-action@v3
304+
with:
305+
image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}"
306+
shell: bash
307+
options: -v ${{ github.workspace }}:/root/src
308+
run: |
309+
set -eux
310+
cat /etc/debian_version
311+
uname -a
312+
make test-app
313+
make test-zlib
314+
make test-openssl
315+
-
316+
# Temp fix
317+
# https://github.com/docker/build-push-action/issues/252
318+
# https://github.com/moby/buildkit/issues/1896
319+
name: Move cache
320+
run: |
321+
rm -rf /tmp/.buildx-cache
322+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
323+
324+
docker-arm64-libs:
325+
name: Docker test libs (arm64)
326+
runs-on: ubuntu-22.04-arm
327+
services:
328+
registry:
329+
image: registry:2
330+
ports:
331+
- 5000:5000
332+
steps:
333+
-
334+
name: Checkout
335+
uses: actions/checkout@v4
336+
with:
337+
fetch-depth: 1
338+
# https://github.com/actions/runner-images/issues/2840
339+
- name: Free disk space
340+
run: |
341+
sudo rm -rf /opt/ghc
342+
sudo rm -rf /usr/share/dotnet
343+
sudo rm -rf /usr/local/lib/android
344+
sudo rm -rf "/usr/local/share/boost"
345+
-
346+
name: Cache Docker layers
347+
uses: actions/cache@v4
348+
with:
349+
path: /tmp/.buildx-cache
350+
key: rust-linux-darwin-builder-arm64-libs-buildx-${{ github.sha }}
351+
restore-keys: |
352+
rust-linux-darwin-builder-arm64-libs-buildx-
353+
-
354+
name: Set up QEMU
355+
uses: docker/setup-qemu-action@v3
356+
-
357+
name: Docker meta
358+
id: meta
359+
uses: docker/metadata-action@v5
360+
with:
361+
images: ${{ env.DOCKER_IMAGE }}
362+
flavor: |
363+
latest=false
364+
suffix=-arm64-libs
365+
tags: |
366+
type=schedule
367+
type=ref,event=branch
368+
type=ref,event=pr
369+
type=semver,pattern={{version}}
370+
type=semver,pattern={{major}}.{{minor}}
371+
type=semver,pattern={{major}}
372+
type=sha
373+
-
374+
name: Set up Docker Buildx
375+
uses: docker/setup-buildx-action@v3
376+
with:
377+
driver-opts: network=host
378+
-
379+
name: Build and export to Docker client
380+
uses: docker/build-push-action@v6
381+
with:
382+
context: .
383+
platforms: linux/arm64
384+
file: docker/arm64/base/Dockerfile
385+
load: true
386+
tags: ${{ steps.meta.outputs.tags }}
387+
labels: ${{ steps.meta.outputs.labels }}
388+
build-args: |
389+
VERSION=0.0.0
390+
BASE_IMAGE=${{ env.DOCKER_IMAGE }}:devel-arm64
391+
push: ${{ github.event_name != 'pull_request' }}
392+
cache-from: type=local,src=/tmp/.buildx-cache
393+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
394+
-
395+
name: Inspect image
396+
run: |
397+
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
398+
-
399+
name: Check manifest
400+
if: github.event_name != 'pull_request'
401+
run: |
402+
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
403+
-
404+
name: Run tests
405+
uses: addnab/docker-run-action@v3
406+
with:
407+
image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}"
408+
shell: bash
409+
options: -v ${{ github.workspace }}:/root/src
410+
run: |
411+
set -eux
412+
cat /etc/debian_version
413+
uname -a
414+
make test-app
415+
make test-zlib
416+
make test-openssl
213417
-
214418
# Temp fix
215419
# https://github.com/docker/build-push-action/issues/252

.github/workflows/release-beta.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: release-beta
22
on:
33
push:
44
tags:
5-
- 'v1.0.[0-9]+-beta.[0-9]+'
65
- 'v2.0.[0-9]+-beta.[0-9]+'
76

87
jobs:

Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ TAG ?= devel
44
# AMD64 Tasks
55

66
amd64-build:
7-
docker buildx build \
7+
docker build \
88
-t $(REPOSITORY):$(TAG)-amd64 \
99
--network=host \
10-
--platform linux/amd64 \
1110
-f docker/amd64/base/Dockerfile .
1211
.PHONY: amd64-build
1312

@@ -29,17 +28,16 @@ amd64-test:
2928
.PHONY: amd64-test
3029

3130
amd64-build-libs:
32-
docker buildx build \
31+
docker build \
3332
-t $(REPOSITORY):$(TAG)-amd64-libs \
3433
--network=host \
35-
--platform linux/amd64 \
3634
-f docker/amd64/libs/Dockerfile .
3735
.PHONY: amd64-build-libs
3836

3937
amd64-run-libs:
4038
@docker run --rm -it \
4139
-v $(PWD):/root/src \
42-
-v $(PWD)/docker/amd64/libs/cargo.toml:/root/.cargo/config.toml \
40+
-v $(PWD)/docker/amd64/base/cargo.toml:/root/.cargo/config.toml \
4341
-w /root/src \
4442
$(REPOSITORY):$(TAG)-amd64-libs \
4543
bash
@@ -57,10 +55,9 @@ amd64-test-libs:
5755
# ARM64 Tasks
5856

5957
arm64-build:
60-
docker buildx build \
58+
docker build \
6159
-t $(REPOSITORY):$(TAG)-arm64 \
6260
--network=host \
63-
--platform linux/arm64 \
6461
-f docker/arm64/base/Dockerfile .
6562
.PHONY: arm64-build
6663

@@ -73,10 +70,9 @@ arm64-test:
7370
.PHONY: arm64-test
7471

7572
arm64-build-libs:
76-
docker buildx build \
73+
docker build \
7774
-t $(REPOSITORY):$(TAG)-arm64-libs \
7875
--network=host \
79-
--platform linux/arm64 \
8076
-f docker/arm64/libs/Dockerfile .
8177
.PHONY: arm64-build-libs
8278

docker/amd64/libs/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM joseluisq/rust-linux-darwin-builder:v2.0.0-beta.1
1+
ARG BASE_IMAGE=joseluisq/rust-linux-darwin-builder:2.0.0-beta.1
2+
3+
FROM ${BASE_IMAGE}
24

35
# zlib - http://zlib.net/
46
ARG ZLIB_VERSION=1.3.1

docker/arm64/libs/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM joseluisq/rust-linux-darwin-builder:v2.0.0-beta.1
1+
ARG BASE_IMAGE=joseluisq/rust-linux-darwin-builder:2.0.0-beta.1
2+
3+
FROM ${BASE_IMAGE}
24

35
# zlib - http://zlib.net/
46
ARG ZLIB_VERSION=1.3.1

0 commit comments

Comments
 (0)