Skip to content

Commit

Permalink
Adds better coverity loop, do it before compiling coverity (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Dec 12, 2024
1 parent c2b4fa7 commit 187688f
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,31 @@ jobs:
mkdir -p ${{ env.COVERITY }}
tar zxf ${{ env.COVERITY }}.tgz -C ${{ env.COVERITY }} --strip-components 1
- name: Wait for Coverity analysis slot
run: |
while true; do
curl -X POST -d version=${{ env.RELEASE_VERSION }} -d description="automated upload" -d email=${{ secrets.COVERITY_EMAIL }} -d token=${{ secrets.COVERITY_TOKEN }} -d file_name="${{ vars.COVERITY_PROJECT_URL_NAME }}.tgz" https://scan.coverity.com/projects/${{ vars.COVERITY_PROJECT_URL_ID }}/builds/init -o response;
if grep -q 'build submission quota' response; then
cat response
echo 'Giving up, submission quota met'
exit 1
fi;
if grep -q 'already in the queue' response; then
cat response
echo 'Waiting for 15 seconds and retrying'
sleep 15
else
break
fi
done
- name: Compile Coverity
run: |
${{ env.COVERITY }}/bin/cov-build --dir cov-int mvn -DskipTests -Pbuild-nogenerate -B -Drevision=${{ env.RELEASE_VERSION }} -Dsha1= -Dchangelist= clean compile
tar czvf ${{ vars.COVERITY_PROJECT_URL_NAME }}.tgz cov-int
- name: Fetch cloud upload url
run: curl -X POST -d version=${{ env.RELEASE_VERSION }} -d description="automated upload" -d email=${{ secrets.COVERITY_EMAIL }} -d token=${{ secrets.COVERITY_TOKEN }} -d file_name="${{ vars.COVERITY_PROJECT_URL_NAME }}.tgz" https://scan.coverity.com/projects/${{ vars.COVERITY_PROJECT_URL_ID }}/builds/init -o response

- name: Wait for Coverity analysis slot
run: |
while grep -q 'already in the queue' response
do
cat response
echo 'Waiting for 15 seconds and retrying'
sleep 15
curl -X POST -d version=${{ env.RELEASE_VERSION }} -d description="automated upload" -d email=${{ secrets.COVERITY_EMAIL }} -d token=${{ secrets.COVERITY_TOKEN }} -d file_name="${{ vars.COVERITY_PROJECT_URL_NAME }}.tgz" https://scan.coverity.com/projects/${{ vars.COVERITY_PROJECT_URL_ID }}/builds/init -o response
done
- name: Prepare response url
run: printf "RESPONSE_URL=%q\n" "$(jq -r '.url' response)" >> $GITHUB_ENV

Expand Down

0 comments on commit 187688f

Please sign in to comment.