Skip to content

ci: consolidate 2 jobs to 1, add arm64 image #6706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
43 changes: 37 additions & 6 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Build container

on:
workflow_call:
inputs:
Expand All @@ -8,22 +7,38 @@ on:
required: true
type: string
file:
description: "Path to Dockerfile"
description: "Path to main Dockerfile"
required: true
type: string
name:
description: "Container name"
description: "Main container name"
required: true
type: string
slim-file:
description: "Path to slim Dockerfile"
required: true
type: string
slim-name:
description: "Slim container name"
required: true
type: string
runs-on:
description: "Runner to use"
required: false
type: string
default: "ubuntu-24.04"
outputs:
path:
description: "Path to built container"
description: "Path to built main container"
value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.name }}:${{ jobs.build.outputs.tag }}
slim-path:
description: "Path to built slim container"
value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.slim-name }}:${{ jobs.build.outputs.tag }}

jobs:
build:
name: Build container
runs-on: ubuntu-24.04
runs-on: ${{ inputs.runs-on }}
outputs:
tag: ${{ steps.prepare.outputs.tag }}
repo: ${{ steps.prepare.outputs.repo }}
Expand Down Expand Up @@ -51,7 +66,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
- name: Build and push SLIM Docker image
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
file: ${{ inputs.slim-file }}
push: true
tags: |
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ hashFiles(inputs.slim-file) }}
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ steps.prepare.outputs.tag }}
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:latest
cache-from: |
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ hashFiles(inputs.slim-file) }}
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ steps.prepare.outputs.tag }}
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:latest
cache-to: type=inline

- name: Build and push MAIN Docker image
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
Expand Down
48 changes: 31 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ concurrency:

jobs:
container:
name: Build container
name: Build containers (amd64)
uses: ./.github/workflows/build-container.yml
with:
context: ./contrib/containers/ci
file: ./contrib/containers/ci/ci.Dockerfile
name: dashcore-ci-runner
slim-file: ./contrib/containers/ci/ci-slim.Dockerfile
slim-name: dashcore-ci-slim

container-slim:
name: Build slim container
container-arm64:
name: Build containers (ARM64)
uses: ./.github/workflows/build-container.yml
with:
context: ./contrib/containers/ci
file: ./contrib/containers/ci/ci-slim.Dockerfile
name: dashcore-ci-slim
file: ./contrib/containers/ci/ci.Dockerfile
name: dashcore-ci-runner
slim-file: ./contrib/containers/ci/ci-slim.Dockerfile
slim-name: dashcore-ci-slim
runs-on: ubuntu-24.04-arm

depends-arm-linux:
name: arm-linux-gnueabihf
Expand Down Expand Up @@ -193,53 +198,62 @@ jobs:
test-linux64:
name: linux64-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64]
needs: [container, src-linux64]
with:
bundle-key: ${{ needs.src-linux64.outputs.key }}
build-target: linux64
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-linux64_multiprocess:
name: linux64_multiprocess-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64_multiprocess]
needs: [container, src-linux64_multiprocess]
with:
bundle-key: ${{ needs.src-linux64_multiprocess.outputs.key }}
build-target: linux64_multiprocess
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-linux64_nowallet:
name: linux64_nowallet-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64_nowallet]
needs: [container, src-linux64_nowallet]
with:
bundle-key: ${{ needs.src-linux64_nowallet.outputs.key }}
build-target: linux64_nowallet
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-linux64_sqlite:
name: linux64_sqlite-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64_sqlite]
needs: [container, src-linux64_sqlite]
with:
bundle-key: ${{ needs.src-linux64_sqlite.outputs.key }}
build-target: linux64_sqlite
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-linux64_tsan:
name: linux64_tsan-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64_tsan]
needs: [container, src-linux64_tsan]
with:
bundle-key: ${{ needs.src-linux64_tsan.outputs.key }}
build-target: linux64_tsan
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-linux64_ubsan:
name: linux64_ubsan-test
uses: ./.github/workflows/test-src.yml
needs: [container-slim, src-linux64_ubsan]
needs: [container, src-linux64_ubsan]
with:
bundle-key: ${{ needs.src-linux64_ubsan.outputs.key }}
build-target: linux64_ubsan
container-path: ${{ needs.container-slim.outputs.path }}
container-path: ${{ needs.container.outputs.slim-path }}

test-arm-linux:
name: arm-linux-test
uses: ./.github/workflows/test-src.yml
needs: [container-arm64, src-arm-linux]
with:
bundle-key: ${{ needs.src-arm-linux.outputs.key }}
build-target: arm-linux
container-path: ${{ needs.container-arm64.outputs.slim-path }}
4 changes: 3 additions & 1 deletion contrib/containers/ci/ci-slim.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ RUN set -ex; \

ARG SHELLCHECK_VERSION=v0.7.1
RUN set -ex; \
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \
ARCH=$(uname -m); \
if [ "$ARCH" = "aarch64" ]; then SHELLCHECK_ARCH="aarch64"; else SHELLCHECK_ARCH="x86_64"; fi; \
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.${SHELLCHECK_ARCH}.tar.xz" -o /tmp/shellcheck.tar.xz; \
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz
ENV PATH="/opt/shellcheck:${PATH}"

Expand Down
Loading