From 713a06e999569e1e94b6973e3de32dd6a585d1a2 Mon Sep 17 00:00:00 2001 From: Danil Titarenko <77471369+danilapog@users.noreply.github.com> Date: Thu, 8 Sep 2022 15:56:49 +0300 Subject: [PATCH] Add expected build arch (#489) * Add fail status if build unexpected platforms * Build: set exit code for action * Build: Change expected platforms message --- .github/workflows/4testing-build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4testing-build.yml b/.github/workflows/4testing-build.yml index cd420b9..0753466 100644 --- a/.github/workflows/4testing-build.yml +++ b/.github/workflows/4testing-build.yml @@ -47,6 +47,7 @@ jobs: DOCKER_TAG=$( echo ${{ env.RELEASE_VERSION }} | sed 's/^.//' ) PACKAGE_VERSION=$( echo $DOCKER_TAG | sed -E 's/(.*)\./\1-/' ) NODE_PLATFORMS=$( echo ${{ steps.buildx.outputs.platforms }} | sed 's/linux\///g' | sed 's/,/ /g' ) + EXPECTED_PLATFORMS="linux/amd64,linux/arm64" echo "Start check avalivable build platforms >>" ### ==>> In this loop we will check all avalivable documentserver architectures. After that all accessed arch will be added to build-platforms list. ### @@ -76,6 +77,15 @@ jobs: echo "DONE: Check passed >> Build for platforms: ${BUILD_PLATFORMS}" echo "Build is starting ... >>" + ### == >> Set exit code for action + if [ ${BUILD_PLATFORMS} == ${EXPECTED_PLATFORMS} ]; then + EXIT_CODE=0 + echo "OK: Build platforms is expected" + else + EXIT_CODE=1 + echo "WARNING: Build platforms is unexpected action is gonna be marked as Failed" + fi + ### ==>> Build and push images at this step ### PRODUCT_EDITION=${{ matrix.edition }} \ PACKAGE_URL=$PACKAGE_URL_BUILD \ @@ -89,6 +99,6 @@ jobs: docker buildx bake \ -f docker-bake.hcl ${{ matrix.images }} \ --push - echo "DONE: Build success >> exit with 0" - exit 0 + echo "DONE: Build success >> exit with ${EXIT_CODE}" + exit ${EXIT_CODE} shell: bash