Skip to content

Commit

Permalink
CI: don't cross build with qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
sveitser committed Dec 4, 2023
1 parent 2d39093 commit 69b5c86
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 48 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/actions/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Espresso Docker Image

inputs:
images:
required: true
type: string
target:
required: true
type: string
platforms:
required: true
type: string

runs:
using: composite
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Repo
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate docker metadata
uses: docker/metadata-action@v4
id: metadata
with:
images: ${{ inputs.images }}

- name: Build and push docker
uses: docker/build-push-action@v4
with:
target: ${{ inputs.target }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: ${{ inputs.platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max
63 changes: 15 additions & 48 deletions .github/workflows/espresso-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# The differences are:
# - Uses GHA docker cache.
# - Does not export the wavm module root as artifact.
#
name: Espresso Docker build CI
run-name: Docker build CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

Expand All @@ -22,64 +21,32 @@ concurrency:
cancel-in-progress: true

jobs:
docker:
name: Docker build
runs-on: ubuntu-latest
docker_build:
strategy:
matrix:
platform: [ "linux/amd64", "linux/arm64" ]
include:
- platform: "linux/amd64"
runs-on: "ubuntu-latest"
- platform: "linux/arm64"
runs-on: "ARM64"

runs-on: [ ${{ matrix.runs-on }} ]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- uses: docker/setup-qemu-action@v3

- name: Setup Docker BuildKit (buildx)
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Repo
uses: docker/login-action@v3
# TODO: uncomment before merge
# if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate nitro-node docker metadata
uses: docker/metadata-action@v5
id: nitro-node
- uses: ./actions/docker-image
with:
images: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node

- name: Build and push nitro-node docker
uses: docker/build-push-action@v5
with:
context: .
target: nitro-node
platforms: linux/amd64,linux/arm64
# push: ${{ github.event_name != 'pull_request' }}
push: true # TODO: remove before merge
tags: ${{ steps.nitro-node.outputs.tags }}
labels: ${{ steps.nitro-node.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform }}

- name: Generate nitro-node-dev docker metadata
uses: docker/metadata-action@v5
id: nitro-node-dev
- uses: ./actions/docker-image
with:
images: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev

- name: Build and push nitro-node-dev docker
uses: docker/build-push-action@v5
with:
context: .
target: nitro-node-dev
platforms: linux/amd64,linux/arm64
# push: ${{ github.event_name != 'pull_request' }}
push: true # TODO: remove before merge
tags: ${{ steps.nitro-node-dev.outputs.tags }}
labels: ${{ steps.nitro-node-dev.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform }}

0 comments on commit 69b5c86

Please sign in to comment.