.github/workflows/coverity.yml #2905
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# scheduled workflows run on the latest commit on the default or base branch | |
schedule: | |
- cron: '0 0/12 * * *' | |
jobs: | |
xrt_coverity_scan: | |
runs-on: ubuntu-latest | |
# Only run in main repository as Coverity scans are limitted | |
if: github.repository == 'Xilinx/XRT' | |
steps: | |
- name: Checkout XRT | |
uses: actions/checkout@v2 | |
- name: Store sha | |
run: echo ${{ github.sha }} > sha | |
- name: Compare sha | |
uses: actions/cache@v2 | |
id: cache-sha | |
with: | |
path: sha | |
key: commit-${{ github.sha }} | |
- name: Download and extract Coverity Build Tool | |
if: steps.cache-sha.outputs.cache-hit != 'true' | |
run: | | |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=Xilinx/XRT" -O cov-analysis-linux64.tar.gz | |
mkdir cov-analysis-linux64 | |
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
- name: Install dependencies | |
if: steps.cache-sha.outputs.cache-hit != 'true' | |
run: | | |
sudo apt update | |
sudo src/runtime_src/tools/scripts/xrtdeps.sh | |
- name: Build with cov-build | |
if: steps.cache-sha.outputs.cache-hit != 'true' | |
run: | | |
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH | |
cov-build --dir cov-int build/build.sh -noert -opt -verbose -driver | |
- name: Submit the results to Coverity Scan | |
if: steps.cache-sha.outputs.cache-hit != 'true' | |
run: | | |
tar czvf xrt.tgz cov-int | |
curl \ | |
--form project=Xilinx/XRT \ | |
--form token=$TOKEN \ | |
--form [email protected] \ | |
--form [email protected] \ | |
--form version=trunk \ | |
--form description=$SHA \ | |
https://scan.coverity.com/builds?project=Xilinx/XRT | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
SHA: ${{ github.sha }} | |
- name: Upload Coverity imed | |
if: steps.cache-sha.outputs.cache-hit != 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cov-int-file | |
path: xrt.tgz |