-
Notifications
You must be signed in to change notification settings - Fork 244
77 lines (74 loc) · 2.51 KB
/
coverity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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 file=@elements.tgz \
--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 }}