Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add wait build reusable workflow #112

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/wait-build-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Backend-switching-tests-gardener (reusable)

on:
workflow_call:
inputs:
repository:
description: Full name of repository (<owner>/<name>).
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
Loading