From 32d7256524511575933bcbba135c49cbacf001d1 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Wed, 18 Sep 2024 11:36:34 +0200 Subject: [PATCH] add wait build reusable workflow --- .github/workflows/wait-build-reusable.yml | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/wait-build-reusable.yml diff --git a/.github/workflows/wait-build-reusable.yml b/.github/workflows/wait-build-reusable.yml new file mode 100644 index 0000000..3d705d2 --- /dev/null +++ b/.github/workflows/wait-build-reusable.yml @@ -0,0 +1,62 @@ +name: Backend-switching-tests-gardener (reusable) + +on: + workflow_call: + inputs: + repository: + description: Full name of repository (/). + required: true + type: string + git_ref: + description: Git reference against which the check will be retrieved. Could be commit SHA, tag or branch name. + required: true + type: string + git_check_run_name: + description: Name of the Git check to wait for. + required: true + type: string + interval: + description: Interval (seconds) for polling the status. + required: false + default: 60 + type: number + timeout: + description: Timeout (seconds) to wait for in total. + required: false + default: 600 + type: number + +jobs: + wait-for-build-job: + name: Wait for build job + runs-on: ubuntu-latest + + steps: + - name: Checkout eventing-tools + uses: actions/checkout@v4 + with: + repository: 'kyma-project/eventing-tools' + path: 'kyma-project/eventing-tools' + ref: main + sparse-checkout: 'scripts/wait-for-commit-check' + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + + - name: Install requirements + run: | + pip install -r $GITHUB_WORKSPACE/kyma-project/eventing-tools/scripts/wait-for-commit-check/requirements.txt + + - name: Wait for build job + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY_FULL_NAME: ${{ inputs.repository }} + GIT_REF: "${{ inputs.git_ref }}" + GIT_CHECK_RUN_NAME: "${{ inputs.git_check_run_name }}" + INTERVAL: ${{ inputs.interval }} + TIMEOUT: ${{ inputs.timeout }} + run: | + python $GITHUB_WORKSPACE/kyma-project/eventing-tools/scripts/wait-for-commit-check/run.py \ No newline at end of file