diff --git a/.github/workflows/container-image-buildah.yml b/.github/workflows/container-image-buildah.yml index fd4d0af..a7da5c4 100644 --- a/.github/workflows/container-image-buildah.yml +++ b/.github/workflows/container-image-buildah.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml new file mode 100644 index 0000000..134aee5 --- /dev/null +++ b/.github/workflows/container-image.yml @@ -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 }} diff --git a/Containerfile b/Containerfile index d7f03d7..7abebf9 100644 --- a/Containerfile +++ b/Containerfile @@ -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" \