Coverity #24
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: Coverity | |
on: | |
schedule: | |
- cron: "0 7 * * 1" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Coverity | |
runs-on: ubuntu-latest | |
environment: Coverity | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install package dependencies | |
id: cmake_and_ninja | |
shell: cmake -P {0} | |
run: | | |
execute_process(COMMAND sudo apt-get update) | |
execute_process(COMMAND sudo apt-get install libcairo2-dev) | |
execute_process(COMMAND sudo apt-get install libgtk-3-dev) | |
execute_process(COMMAND sudo apt-get install ninja-build) | |
execute_process(COMMAND sudo apt-get install libwebp-dev) | |
execute_process(COMMAND sudo apt-get install wget) | |
- name: Download Coverity Build Tool | |
run: | | |
wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=cycfi%2Felements" -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: Configure | |
shell: cmake -P {0} | |
run: | | |
set(ENV{CC} gcc-11) | |
set(ENV{CXX} g++-11) | |
execute_process( | |
COMMAND ${CMAKE_COMMAND} | |
-S . | |
-B build | |
-D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE} | |
-G Ninja | |
-D CMAKE_MAKE_PROGRAM=ninja | |
RESULT_VARIABLE result | |
ERROR_VARIABLE error_message | |
) | |
if (NOT result EQUAL 0) | |
message(FATAL_ERROR "Could not run with ${CMAKE_COMMAND}: Got ${error_message} - ${result}") | |
endif() | |
- name: Build | |
shell: cmake -P {0} | |
run: | | |
execute_process( | |
COMMAND cov-analysis-linux64/bin/cov-build --dir cov-int ${CMAKE_COMMAND} --build build | |
RESULT_VARIABLE result | |
ERROR_VARIABLE error_message | |
) | |
if (NOT result EQUAL 0) | |
message(FATAL_ERROR "Could not run with ${CMAKE_COMMAND}: Got ${error_message} - ${result}") | |
endif() | |
- name: Submit the result to Coverity Scan | |
run: | | |
tar czvf elements.tgz cov-int | |
curl \ | |
--form token=$TOKEN \ | |
--form email=$EMAIL \ | |
--form [email protected] \ | |
--form version="master" \ | |
--form description="master" \ | |
https://scan.coverity.com/builds?project=cycfi%2Felements | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} |