cov-build #39
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
name: cov-build | |
on: | |
schedule: | |
- cron: '0 18 * * 3' | |
push: | |
tags: | |
- v*.*.* | |
- coverity* | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '!README.md' | |
- '!CONTRIBUTING.md' | |
- '!docs/**' | |
- 'include/**' | |
- 'demo/**' | |
- '.github/**' | |
- 'tests/**' | |
env: | |
TOKEN: ${{secrets.COVERITY_TOKEN}} | |
EMAIL: ${{secrets.COVERITY_EMAIL}} | |
jobs: | |
x64: | |
runs-on: windows-2022 | |
defaults: | |
run: | |
shell: powershell | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: Install tools | |
run: | | |
choco install -y unzip | |
choco install -y wget | |
choco install -y curl | |
- name: Cache Coverity scan tools | |
uses: actions/cache@v2 | |
with: | |
path: ${{github.workspace}}/cov_tools | |
key: x64-coverity-cache | |
- name: Install Coverity scan tools | |
if: ${{ hashFiles('cov_tools/') == '' }} | |
run: | | |
wget.exe https://scan.coverity.com/download/cxx/win64 --post-data "token=${{env.TOKEN}}&project=pit-ray%2Ffluent-tray" -O cov_tools.zip | |
unzip cov_tools.zip | |
mv cov-analysis-win64-*.* cov_tools | |
- name: Configure CMake | |
run: | | |
cov_tools/bin/cov-configure --config build/covtest/cov.xml --msvc --template | |
cmake -B build -A x64 demo | |
- name: Build with Coverity | |
run: | | |
cov_tools/bin/cov-build --config build/covtest/cov.xml --dir build/cov-int cmake --build build | |
cd build | |
tail cov-int/build-log.txt | |
tar -czvf cov-int.tgz cov-int | |
cd .. | |
- name: Get short SHA | |
id: vars | |
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: Submit tarball to Coverity | |
run: curl.exe \ | |
--form token="${{env.TOKEN}}" \ | |
--form email="${{env.EMAIL}}" \ | |
--form file="@build/cov-int.tgz" \ | |
--form version="${{steps.vars.outputs.sha_short}}" \ | |
--form description="Automatic submission with GitHub Actions" \ | |
"https://scan.coverity.com/builds?project=pit-ray%2Ffluent-tray" |