Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <dcassany@suse.com>
  • Loading branch information
davidcassany committed Aug 24, 2023
1 parent 7fd2715 commit 688b06d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/actions/wait-commit-status/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Wait for commit status

inputs:
repository:
required: true
commit:
required: true
context:
required: true
status:
required: true
interval:
required: false
default: 60
retries:
required: false
default: 10

runs:
using: composite
steps:
- name: Wait for commit status ${{ inputs.context }}
shell: bash
env:
REPO: ${{ inputs.repository }}
COMMIT: ${{ inputs.commits }}
CONTEXT: ${{ inputs.context }}
STATUS: ${{ inputs.status }}
SLEEP: ${{ inputs.interval }}
RETRIES: ${{ inputs.retries }}
QUERY_URL: https://api.github.com/repos/${REPO}/statuses/${COMMIT}
JQ_SELECTOR: select((.context=="${CONTEXT}") and (.state=="${STATUS}"))
run: |
set -x
for i in $(seq ${RETRIES}); do
RESULT=$(curl -s "${QUERY_URL}" | jq '[.[] | ${JQ_SELECTOR}][0]')
echo "${RESULT}"
[ "${RESULT}" != "null" ] && break
echo "Waiting, retrying in ${SLEEP} seconds"
sleep ${SLEEP}
done
[ "${RESULT}" == null ] && exit 1
15 changes: 6 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Wait for OBS seedimage-builder build
uses: cloudposse/github-action-wait-commit-status@main
- name: Wait for OBS worflow to start
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
sha: ${{ github.sha }}
status: "OBS: seedimage-builder - containers/x86_64"
expected_state: "success"
token: ${{ github.token }}
check-retry-count: 30
check-retry-interval: 60
commit: ${{ github.sha }}
context: "OBS SCM/CI Workflow Integration started"
status: "success"
- name: Wait for OBS operator-image build
uses: cloudposse/github-action-wait-commit-status@main
with:
Expand All @@ -35,7 +32,7 @@ jobs:
status: "OBS: operator-image - containers/x86_64"
expected_state: "success"
token: ${{ github.token }}
check-retry-count: 30
check-retry-count: 10
check-retry-interval: 60
- name: Build chart for release
env:
Expand Down

0 comments on commit 688b06d

Please sign in to comment.