Skip to content

Commit 8f19267

Browse files
authored
CI: enable daily coverity scan
1 parent f020573 commit 8f19267

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/coverity.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# --------------------------------------------------------------------
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed
5+
# with this work for additional information regarding copyright
6+
# ownership. The ASF licenses this file to You under the Apache
7+
# License, Version 2.0 (the "License"); you may not use this file
8+
# except in compliance with the License. You may obtain a copy of the
9+
# License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16+
# implied. See the License for the specific language governing
17+
# permissions and limitations under the License.
18+
#
19+
# --------------------------------------------------------------------
20+
# GitHub Actions Workflow: Apache Cloudberry Coverity Scan Pipeline
21+
# --------------------------------------------------------------------
22+
# Description:
23+
#
24+
# This workflow performs scheduled coverity scan of Apache Cloudberry.
25+
#
26+
# Workflow Overview:
27+
# 1. **Check Skip**:
28+
# - workflow run currently is limited to "apache" GitHub organization, forks are ignored
29+
#
30+
# 2. **scan Job**:
31+
# - performs scan and upload result to https://scan.coverity.com/projects/cloudberry?tab=overview
32+
# Triggers:
33+
# - daily schedule
34+
# - optional manual dispatch.
35+
#
36+
# Notes:
37+
# - COVERITY_SCAN_TOKEN secret is used.
38+
# --------------------------------------------------------------------
39+
name: Coverity
40+
41+
on:
42+
schedule:
43+
- cron: "0 0 * * *"
44+
workflow_dispatch:
45+
46+
permissions:
47+
contents: read
48+
49+
jobs:
50+
scan:
51+
runs-on: ubuntu-latest
52+
if: ${{ github.repository_owner == 'apache' }}
53+
54+
env:
55+
DEBIAN_FRONTEND: noninteractive
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Install apt dependencies
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install -y bison cmake curl flex git-core gcc g++ inetutils-ping krb5-kdc krb5-admin-server libapr1-dev libbz2-dev libcurl4-gnutls-dev libevent-dev libkrb5-dev libpam-dev libperl-dev libreadline-dev libssl-dev libxerces-c-dev libxml2-dev libyaml-dev libzstd-dev locales net-tools ninja-build openssh-client openssh-server openssl pkg-config python3-dev python3-pip python3-psutil python3-pygresql python3-yaml zlib1g-dev
63+
pip3 install conan
64+
65+
- name: Download Coverity build tool
66+
run: |
67+
wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=apache%2Fcloudberry" -O coverity_tool.tar.gz
68+
mkdir coverity_tool
69+
tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool
70+
- name: Build with Coverity build tool
71+
run: |
72+
./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=/usr/local/cloudberrydb
73+
export PATH=`pwd`/coverity_tool/bin:$PATH
74+
cov-build --dir cov-int make -j$(nproc)
75+
- name: Submit build result to Coverity Scan
76+
run: |
77+
tar czvf cov.tar.gz cov-int
78+
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
79+
80+
81+
--form version="Commit $GITHUB_SHA" \
82+
--form description="Build submitted via CI" \
83+
https://scan.coverity.com/builds?project=apache%2Fcloudberry

0 commit comments

Comments
 (0)