Skip to content

Commit

Permalink
Fix process load test results workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK authored Aug 14, 2024
1 parent 38cb406 commit 0a6fc90
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/process-load-test-results-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,21 @@ jobs:
done
env:
GITHUB_TOKEN: ${{ secrets.ballerina_bot_token }}
- name: Check if the load-test-results branch exists
if: ${{ steps.processResults.outputs.hasPassed }}
id: check_branch
run: |
if git ls-remote --heads origin load-test-results | grep -q "refs/heads/load-test-results"; then
echo "branch_exists=true" >> $GITHUB_ENV
else
echo "branch_exists=false" >> $GITHUB_ENV
fi
- name: Delete existing load-test-results branch
if: ${{ steps.check_branch.outputs.branch_exists }}
run: git push origin --delete load-test-results
- name: Push results
if: ${{ steps.processResults.outputs.hasPassed }}
run: git push origin "load-test-results"
run: git push origin load-test-results
env:
GITHUB_TOKEN: ${{ secrets.ballerina_bot_token }}
- name: Create pull request for new summary
Expand Down Expand Up @@ -95,22 +107,8 @@ jobs:
- name: Merge PR
if: ${{ steps.processResults.outputs.hasPassed }}
run: |
if [[ ${{ steps.processResults.outputs.branch }} == "null" ]]
then
checkCount="0"
while [ "$checkCount" != "3" ]
do
sleep 20
checkCount=$(gh pr status --jq '[.currentBranch .statusCheckRollup[] | select((.conclusion=="SUCCESS") and ((.name=="Run PR Build Workflow / Build on Ubuntu") or (.name=="Run PR Build Workflow / Build on Windows") or (.name=="codecov/project")))] | length' --json statusCheckRollup)
failedCount=$(gh pr status --jq '[.currentBranch .statusCheckRollup[] | select((.conclusion=="FAILURE") and ((.name=="Run PR Build Workflow / Build on Ubuntu") or (.name=="Run PR Build Workflow / Build on Windows") or (.name=="codecov/project")))]|length' --json statusCheckRollup)
if [[ "$failedCount" != "0" ]]
then
echo "PR Build has failed"
exit 1
fi
done
sleep 20
fi
gh pr checks ${{ steps.createPR.outputs.prUrl }} --required --watch --interval 20
sleep 5
gh pr merge ${{ steps.createPR.outputs.prUrl }} --merge --delete-branch
env:
GITHUB_TOKEN: ${{ secrets.ballerina_bot_token }}
Expand Down

0 comments on commit 0a6fc90

Please sign in to comment.