Skip to content

Commit

Permalink
CI: try to fix Coverity Scan builds upload [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 29, 2024
1 parent 2a64484 commit 6da37eb
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/coverity_scan/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,32 @@ cmake ${GDAL_SOURCE_DIR:=..} \

/tmp/cov-analysis-linux64/bin/cov-build --dir cov-int make "-j$(nproc)"
tar czf cov-int.tgz cov-int
curl \
--form token=$COVERITY_SCAN_TOKEN \
--form email=$COVERITY_SCAN_EMAIL \
--form file=@cov-int.tgz \
--form version=master \
--form description="`git rev-parse --abbrev-ref HEAD` `git rev-parse --short HEAD`" \
https://scan.coverity.com/builds?project=GDAL

apt-get install -y jq

## Below from https://scan.coverity.com/projects/gdal/builds/new

# Initialize a build. Fetch a cloud upload url.
curl -X POST \
-d version=master \
-d description="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short HEAD)" \
-d token=$COVERITY_SCAN_TOKEN \
-d email=$COVERITY_SCAN_EMAIL \
-d file_name="cov-int.tgz" \
https://scan.coverity.com/projects/749/builds/init \
| tee response

# Store response data to use in later stages.
upload_url=$(jq -r '.url' response)
build_id=$(jq -r '.build_id' response)

# Upload the tarball to the Cloud.
curl -X PUT \
--header 'Content-Type: application/json' \
--upload-file cov-int.tgz \
$upload_url

# Trigger the build on Scan.
curl -X PUT \
-d token=$COVERITY_SCAN_TOKEN \
https://scan.coverity.com/projects/749/builds/$build_id/enqueue

0 comments on commit 6da37eb

Please sign in to comment.