Skip to content

Commit

Permalink
parametrize archs and skip s390
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Nov 7, 2023
1 parent 5c3d888 commit fb12419
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/container-image-buildah.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Container Image
name: Container Image Reusable Workflow

on:
workflow_dispatch: {}
workflow_call: {}
schedule:
# every Wednesday morning
- cron: 7 7 * * 3
push:
branches: [ main ]
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
inputs:
platforms:
description: comma-separated list of platforms to build for, e.g. linux/amd64,linux/s390x,linux/ppc64le
default: linux/amd64,linux/ppc64le
type: string
custom_tag:
description: optional custom tag on remote repo you want image to be tagged with
required: false
default: ''
type: string

concurrency:
group: ci-container-build-${{ github.ref }}-1
Expand Down Expand Up @@ -49,7 +51,9 @@ jobs:
tags: |
type=schedule
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
${{ github.ref_name == 'main' && 'type=raw,value=nightly' || 'type=ref,event=branch' }}
type=raw,value=nightly,enable=${{ github.ref_name == 'main' }}
type=ref,event=branch,enable=${{ github.ref_name != 'main' && inputs.custom_tag == '' }}
${{ inputs.custom_tag }}
type=ref,event=tag
type=ref,event=pr
Expand All @@ -61,7 +65,7 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/s390x,linux/ppc64le
platforms: ${{ inputs.platforms }}
labels: ${{ steps.meta.outputs.labels }}
layers: false
oci: true
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Container Image

on:
schedule:
# every Wednesday morning
- cron: 7 7 * * 3
push:
branches: [ main ]
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
platforms:
description: comma-separated list of platforms to build for, downstream supported are linux/amd64,linux/s390x,linux/ppc64le; note: clang is broken on s390x (RHEL-15874) and gcc takes more than 6 hours so we don't build it by default
default: linux/amd64,linux/ppc64le
custom_tag:
description: a custom tag on remote repo you want image to be tagged with
default: scratch

jobs:
call-build:
uses: ./.github/workflows/container-image-buildah.yml
with:
platforms: ${{ inputs.platforms == '' && 'linux/amd64,linux/ppc64le' || inputs.platforms }}
custom_tag: ${{ inputs.custom_tag }}
5 changes: 2 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ ENV SEARCHD_REF=6.2.12 \
WORKDIR $BUILD_PATH

SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
# clang is broken on s390x (RHEL-15874), to use gcc remove CC and CXX variables,
# also replace llvm-toolset with make automake gcc gcc-c++ kernel-devel
# hadolint ignore=DL3003,DL3032,SC2046
RUN yum install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs llvm-toolset mysql cmake boost-devel openssl-devel zlib-devel bison flex systemd-units rpm-build git && \
git clone --depth=1 --branch=$SEARCHD_REF $SEARCHD_REPO . && \
sed -i -e 's/Boost_USE_STATIC_LIBS ON/Boost_USE_STATIC_LIBS OFF/' src/CMakeLists.txt && \
mkdir build && cd build && \
clang-16 --version && clang++-16 --version && \
cmake $BUILD_FLAGS .. && \
cmake --build . --target package --config RelWithDebInfo

# /tmp/manticore_uselessly_long_path_to_prevent_rpm_build_issues/build/manticore-tools-debuginfo-6.2.12_230823.4553471-1.el9.x86_64.rpm and other RPMs

FROM quay.io/centos/centos:stream9-minimal

LABEL org.opencontainers.image.authors="https://issues.redhat.com/browse/THREESCALE" \
Expand Down

0 comments on commit fb12419

Please sign in to comment.