From aa86075159b2a7339aeefcfd11cae50ef0109188 Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Wed, 3 Jul 2024 17:46:14 +0100 Subject: [PATCH] ci: Fix nightly (#1514) --- .github/workflows/build_clio_docker_image.yml | 17 +++++++++++++---- .github/workflows/nightly.yml | 10 ++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_clio_docker_image.yml b/.github/workflows/build_clio_docker_image.yml index 4777699ba..6a3594684 100644 --- a/.github/workflows/build_clio_docker_image.yml +++ b/.github/workflows/build_clio_docker_image.yml @@ -13,6 +13,10 @@ on: type: boolean description: Whether to strip clio binary default: true + publish_image: + type: boolean + description: Whether to publish docker image + required: true workflow_dispatch: inputs: @@ -59,10 +63,15 @@ jobs: - name: Unpack binary shell: bash run: | + sudo apt update && sudo apt install -y tar unzip cd docker/clio/artifact - artifact=$(find . -type file) - tar -xvf $artifact - mv clio_server ../clio_server + artifact=$(find . -type f) + if [[ $artifact == *.zip ]]; then + unzip $artifact + elif [[ $artifact == *.tar.gz ]]; then + tar -xvf $artifact + fi + mv clio_server ../ cd ../ rm -rf ./artifact @@ -79,7 +88,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: image_name: rippleci/clio - push_image: true + push_image: ${{ inputs.publish_image }} directory: docker/clio tags: ${{ inputs.tags }} platforms: linux/amd64 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 27fc1f394..ebef2ab1d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,6 +3,10 @@ on: schedule: - cron: '0 5 * * 1-5' workflow_dispatch: + pull_request: + paths: + - '.github/workflows/nightly.yml' + - '.github/workflows/build_clio_docker_image.yml' jobs: build: @@ -130,6 +134,7 @@ jobs: ./clio_integration_tests --backend_host=scylladb nightly_release: + if: ${{ github.event_name != 'pull_request' }} needs: run_tests runs-on: ubuntu-20.04 env: @@ -174,17 +179,18 @@ jobs: build_and_publish_docker_image: uses: ./.github/workflows/build_clio_docker_image.yml + needs: run_tests secrets: inherit with: tags: | type=raw,value=nightly - type=ref,value=${{ env.GITHUB_SHA }} artifact_name: clio_server_Linux_Release strip_binary: true + publish_image: ${{ github.event_name != 'pull_request' }} create_issue_on_failure: needs: [build, run_tests, nightly_release] - if: ${{ always() && contains(needs.*.result, 'failure') }} + if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name != 'pull_request' }} runs-on: ubuntu-20.04 permissions: contents: write