Skip to content

Commit

Permalink
ci: Slight improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed May 24, 2024
1 parent 174f790 commit a1f30be
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,28 @@ jobs:
GH_TOKEN: ${{ secrets.TESTING_PUSH_TOKEN }}
run: make reset-history

- name: Wait success of generated project's workflow
- name: Wait for success of generated project's workflow
env:
GH_TOKEN: ${{ github.token }}
run: |
cd tests/tmp || exit 1
while true; do
echo "Waiting 5 seconds..."
sleep 5
echo "Fetching CI workflow..."
if ! output=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json status,conclusion); then
continue
fi
status=$(jq -r ".[0].status" <<< "$output")
if [ "${status}" = "completed" ]; then
echo "Workflow completed!"
conclusion=$(jq -r ".[0].conclusion" <<< "$output")
echo "Status: ${conclusion}"
[ "${conclusion}" == "success" ] && break || exit 1
if output=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json status,conclusion); then
status=$(jq -r ".[0].status" <<< "$output")
if [ "${status}" = "completed" ]; then
echo "Workflow completed!"
conclusion=$(jq -r ".[0].conclusion" <<< "$output")
echo "Status: ${conclusion}"
[ "${conclusion}" == "success" ] && break || exit 1
else
echo "Workflow status: ${status}"
fi
else
echo "Workflow status: ${status}"
echo "Workflow not found, retrying in 20 seconds"
fi
sleep 20
done
echo "Delete all testing releases..."
echo "Deleting all testing releases..."
for tag in $(gh release list --repo pawamoy/pawamoy-testing --json tagName --jq ".[].tagName"); do
gh release delete --repo pawamoy/pawamoy-testing --tag "${tag}" --yes --cleanup-tag
gh release delete "${tag}" --repo pawamoy/pawamoy-testing --yes --cleanup-tag
done

0 comments on commit a1f30be

Please sign in to comment.