Skip to content
Draft

v2.0 #37

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
97 changes: 0 additions & 97 deletions .cirrus.yml

This file was deleted.

227 changes: 227 additions & 0 deletions .github/workflows/devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
name: devel
on:
pull_request:
branches:
- master
paths:
- docker/**
- .github/workflows/*.yml
push:
branches:
- master
paths:
- docker/**
- .github/workflows/*.yml

env:
DOCKER_IMAGE: localhost:5000/github.com/joseluisq/rust-linux-darwin-builder

jobs:
docker-amd64:
name: Docker test (amd64)
runs-on: ubuntu-22.04
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
-
name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: rust-linux-darwin-builder-amd64-buildx-${{ github.sha }}
restore-keys: |
rust-linux-darwin-builder-amd64-buildx-
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
flavor: |
latest=false
suffix=-amd64
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
-
name: Build and export to Docker client
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
file: docker/amd64/Dockerfile
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=0.0.0
-
name: Build and push to local registry
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
file: docker/amd64/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=0.0.0
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
-
name: Inspect image
run: |
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
-
name: Check manifest
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
-
name: Run tests
uses: addnab/docker-run-action@v3
with:
image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}"
shell: bash
run: |
set -eux
cat /etc/debian_version
uname -a
make test-app
make test-zlib
make test-openssl
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

docker-arm64:
name: Docker test (arm64)
runs-on: ubuntu-22.04-arm
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
-
name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: rust-linux-darwin-builder-arm64-buildx-${{ github.sha }}
restore-keys: |
rust-linux-darwin-builder-arm64-buildx-
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
flavor: |
latest=false
suffix=-arm64
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
-
name: Build and export to Docker client
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
file: docker/arm64/Dockerfile
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=0.0.0
-
name: Build and push to local registry
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
file: docker/arm64/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=0.0.0
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

-
name: Inspect image
run: |
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
-
name: Check manifest
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}
-
name: Run tests
uses: addnab/docker-run-action@v3
with:
image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}"
shell: bash
run: |
set -eux
cat /etc/debian_version
uname -a
make test-app
make test-zlib
make test-openssl
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Loading
Loading