2020-07-17 18:42:14 +00:00
|
|
|
# This script is responsible for configuring the coverity file from the cache
|
|
|
|
# (e.g. extracting it or updating it if needed)
|
|
|
|
.coverity_cache_prep: &coverity_cache_prep |
|
|
|
|
echo "Downloading MD5 hash of current Coverity Scan version to compare against cache"
|
|
|
|
curl --output cov-analysis-linux64.md5 https://scan.coverity.com/download/linux64 \
|
|
|
|
--form project=$COVERITY_SCAN_PROJECT_NAME \
|
|
|
|
--form token=$COVERITY_SCAN_TOKEN \
|
|
|
|
--form md5=1
|
2020-07-19 02:20:33 +00:00
|
|
|
echo " *cov-analysis-linux64.tgz" >> cov-analysis-linux64.md5
|
2021-06-07 03:27:06 +00:00
|
|
|
(md5sum --ignore-missing -c cov-analysis-linux64.md5) || (
|
2020-07-17 18:42:14 +00:00
|
|
|
echo "Downloading new Coverity Scan version"
|
|
|
|
curl --output cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 \
|
|
|
|
--form project=$COVERITY_SCAN_PROJECT_NAME \
|
|
|
|
--form token=$COVERITY_SCAN_TOKEN
|
|
|
|
)
|
|
|
|
echo "Extracting Coverity Scan"
|
|
|
|
mkdir coverity/
|
|
|
|
tar xzf cov-analysis-linux64.tgz --strip-components=1 -C coverity
|
|
|
|
test -d coverity/bin
|
|
|
|
|
|
|
|
# This script is responsible for tar'ing and submitting the results of the build.
|
|
|
|
# These results will be saved for 1 day if the build fails.
|
|
|
|
.coverity_submit: &coverity_submit |
|
|
|
|
echo "Creating tar file of scan results"
|
2023-05-07 00:47:56 +00:00
|
|
|
export COV_INT_FILENAME=cov-int-$(date +"%Y%m%d%H%M").tar.gz
|
|
|
|
tar cfz $COV_INT_FILENAME cov-int
|
2020-07-17 18:42:14 +00:00
|
|
|
echo "Submitting scan results"
|
2023-05-07 02:42:41 +00:00
|
|
|
s5cmd/s5cmd cp $COV_INT_FILENAME s3://$KICAD_CI_R2_BUCKET/coverity/
|
2023-05-07 01:49:21 +00:00
|
|
|
export FILE_URL="$KICAD_CI_R2_PUBLIC_BASE/coverity/$COV_INT_FILENAME"
|
2020-07-22 22:48:16 +00:00
|
|
|
export KICAD_VERSION=$(sed 's/[()]//g' kicad_build_version.txt)
|
2022-07-11 14:09:49 +00:00
|
|
|
curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
|
2020-07-17 18:42:14 +00:00
|
|
|
--form token=$COVERITY_SCAN_TOKEN \
|
|
|
|
--form email=$GITLAB_USER_EMAIL \
|
2023-05-07 01:49:21 +00:00
|
|
|
--form url="$FILE_URL" \
|
2020-07-22 22:48:16 +00:00
|
|
|
--form version="$KICAD_VERSION" \
|
|
|
|
--form description="$KICAD_VERSION / $CI_COMMIT_TITLE" 2>&1 \
|
2020-07-17 18:42:14 +00:00
|
|
|
| tee curl-response.txt
|
|
|
|
grep -q 'Build successfully submitted' curl-response.txt
|
|
|
|
|
|
|
|
|
|
|
|
Coverity:
|
|
|
|
tags:
|
|
|
|
- coverity
|
|
|
|
stage: build
|
2023-10-20 18:31:22 +00:00
|
|
|
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:38
|
2023-05-06 12:20:56 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "coverity"
|
2020-07-17 18:42:14 +00:00
|
|
|
cache:
|
|
|
|
key: coverity
|
|
|
|
paths:
|
|
|
|
- cov-analysis-linux64.tgz
|
|
|
|
before_script:
|
|
|
|
- export COVERITY_SCAN_PROJECT_NAME="kicad"
|
2020-07-21 22:13:58 +00:00
|
|
|
- test "$(git rev-parse --is-shallow-repository)" = "false" || (git fetch --unshallow)
|
|
|
|
- git fetch origin
|
2023-05-07 00:47:56 +00:00
|
|
|
- curl -LO https://github.com/peak/s5cmd/releases/download/v2.0.0/s5cmd_2.0.0_Linux-64bit.tar.gz
|
|
|
|
- mkdir s5cmd
|
|
|
|
- tar -xvf ./s5cmd_2.0.0_Linux-64bit.tar.gz -C s5cmd
|
|
|
|
- export AWS_ACCESS_KEY_ID=$KICAD_CI_R2_KEY_ID
|
|
|
|
- export AWS_SECRET_ACCESS_KEY=$KICAD_CI_R2_ACCESS_KEY
|
|
|
|
- export S3_ENDPOINT_URL=$KICAD_CI_R2_ENDPOINT
|
2020-07-17 18:42:14 +00:00
|
|
|
script:
|
|
|
|
- *coverity_cache_prep
|
|
|
|
- cmake
|
2023-04-17 23:19:19 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
2020-07-17 18:42:14 +00:00
|
|
|
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
|
|
|
-DKICAD_SCRIPTING_WXPYTHON=ON
|
2023-05-07 01:49:21 +00:00
|
|
|
- coverity/bin/cov-build --dir cov-int make -j10
|
2020-07-17 18:42:14 +00:00
|
|
|
- *coverity_submit
|
2021-01-05 23:34:09 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 1 year
|
|
|
|
expose_as: 'Coverity log'
|
|
|
|
name: "coverity_log.txt"
|
|
|
|
paths:
|
2023-05-07 00:47:56 +00:00
|
|
|
- cov-int/build-log.txt
|