Skip to content

Commit

Permalink
Update coverity build to use their new api (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Dec 9, 2024
1 parent e5f1532 commit 7bec74d
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
verify:
name: Verify Code
runs-on: ubuntu-latest
if: ${{ startsWith(github.repository, 'teragrep/') }}

env:
COVERITY: coverity_tool
Expand Down Expand Up @@ -75,36 +76,39 @@ jobs:

- name: Download Coverity
run: |
wget --quiet https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=pth_06" -O ${RUNNER_TEMP}/${{ env.COVERITY }}.tgz
mkdir -p ${RUNNER_TEMP}/${{ env.COVERITY }}
tar zxvf ${RUNNER_TEMP}/${{ env.COVERITY }}.tgz -C ${RUNNER_TEMP}/${{ env.COVERITY }} --strip-components 1
wget --quiet https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=pth_06" -O ${{ env.COVERITY }}.tgz
mkdir -p ${{ env.COVERITY }}
tar zxvf ${{ env.COVERITY }}.tgz -C ${{ env.COVERITY }} --strip-components 1
- name: Compile Coverity
run: |
${RUNNER_TEMP}/${{ env.COVERITY }}/bin/cov-configure --java
${RUNNER_TEMP}/${{ env.COVERITY }}/bin/cov-build --dir ${RUNNER_TEMP}/cov-int mvn -Pbuild-nogenerate -B -Drevision=${{ env.RELEASE_VERSION }} -Dsha1= -Dchangelist= -DskipTests=true clean compile
tar czvf ${RUNNER_TEMP}/pth_06.tgz ${RUNNER_TEMP}/cov-int
- name: Debug find src contents
run: find src/ -exec ls -l {} \;
- name: Print all directory sizes
run: du -sh *
- name: Debug print contents
run: tar tvzf ${RUNNER_TEMP}/pth_06.tgz
- name: Debug print size
run: du -sh ${RUNNER_TEMP}/pth_06.tgz
- name: Debug find cov-int
run: find ${RUNNER_TEMP}/cov-int
- name: Debug search ${RUNNER_TEMP}
run: find ${RUNNER_TEMP} -exec ls -l {} \;
- name: Debug size ${RUNNER_TEMP}
run: du -sh ${RUNNER_TEMP}/*
${{ env.COVERITY }}/bin/cov-build --dir cov-int mvn -Pbuild-nogenerate -B -Drevision=${{ env.RELEASE_VERSION }} -Dsha1= -Dchangelist= clean compile
tar czvf pth_06.tgz cov-int
- name: Install jq
run: |
sudo apt-get update && sudo apt-get install jq
- name: Fetch cloud upload url
run: |
curl -X POST \
-d version="${GITHUB_REF##*/}" \
-d description="automated upload" \
-d email=${{ secrets.COVERITY_EMAIL }} \
-d token=${{ secrets.COVERITY_TOKEN }} \
-d file_name="pth_06.tgz" \
https://scan.coverity.com/projects/30661/builds/init \
| tee response
- name: Upload to Coverity
run: |
curl --silent --form token=${{ secrets.COVERITY_TOKEN }} \
--form email=${{ secrets.COVERITY_EMAIL }} \
--form file=@${RUNNER_TEMP}/pth_06.tgz \
--form version="${GITHUB_REF##*/}" \
--form description="automated upload" \
https://scan.coverity.com/builds?project=pth_06
curl -X PUT \
--header 'Content-Type: application/json' \
--upload-file pth_06.tgz \
"$(jq -r '.url' response)"
- name: Trigger Coverity build
run: |
curl -X PUT \
-d token${{ secrets.COVERITY_TOKEN }} \
"https://scan.coverity.com/projects/30661/builds/$(jq -r '.build_id' response)/enqueue"

0 comments on commit 7bec74d

Please sign in to comment.