From 3e1afd1e00fa5a0e61143154e1ba5d2147f81a1d Mon Sep 17 00:00:00 2001 From: vit9696 Date: Mon, 12 Nov 2018 11:06:44 +0300 Subject: [PATCH] Attempt to integrate static analysis --- .travis.yml | 26 +++++++++++++++++++++++ README.md | 2 +- unixbuild.sh | 58 ++++++++++++++++++++++++++++------------------------ 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91f88f1..2c16157 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: cpp + +env: + global: + secure: "cWSx7cf7dOyGzqY12imfKIF0G0ImcjChHLpWuDU4dfSl+BvPh8WURhQqwpPihFzA4j+Ob9IdgJdEINW4ZKs5Fqt9NqpqTbsGlv7xMeGSNMymlwzwrY63CU8td6z/ju8Tgvi9I7aHtrYCbi4RCw2vPRzBihgwXTzQg6LWFoVT+XQ=" + matrix: include: - os: osx @@ -50,3 +55,24 @@ matrix: secure: "WjYd93lVLKHULBpUXS/WtGrkdXyAwxHOUnLJotyDmQipAQP5Ox7Kj12JwkSJGEmVOEdcbIQJyi0QxPjn1UYbYsAt6Op8zrjnYLS4G4fMdBtcxprWzid85uTW7oAAIFs7ygMVhpzxRKpu70yNb683vbThqNmaOu6RyG9aJOLtPAg=" on: tags: true + + - os: linux + dist: trusty + compiler: clang + + before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq qt5-default qt5-qmake qtbase5-dev-tools cmake + + script: + - echo "This script runs coverity..." + + addons: + coverity_scan: + project: + name: "LongSoft/UEFITool" + description: "UEFITool" + notification_email: $NOTIFICATION_EMAIL + build_command_prepend: "NOBUILD=1 ./unixbuild.sh" + build_command: "PRECONFIGURED=1 ./unixbuild.sh" + branch_pattern: new_engine diff --git a/README.md b/README.md index 7d04c35..dee8c9b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ UEFITool is a viewer and editor of firmware images conforming to UEFI Platform Interface (PI) Specifications. ![UEFITool icon](https://raw.githubusercontent.com/LongSoft/UEFITool/new_engine/UEFITool/icons/uefitool_64x64.png "UEFITool icon") -![Coverity badge](https://scan.coverity.com/projects/1812/badge.svg?flat=1 "Coverity badge") +[![Build Status](https://travis-ci.org/LongSoft/UEFITool.svg?branch=master)](https://travis-ci.org/LongSoft/UEFITool) [![Scan Status](https://scan.coverity.com/projects/17209/badge.svg?flat=1)](https://scan.coverity.com/projects/17209) ## Very Brief Introduction to UEFI diff --git a/unixbuild.sh b/unixbuild.sh index 2594f7d..17370fd 100755 --- a/unixbuild.sh +++ b/unixbuild.sh @@ -70,39 +70,43 @@ build_tool() { cd "$1" || exit 1 # Build - if [ "$3" != "" ]; then - # -flto is flawed on CI atm - if [ "$UPLATFORM" = "mac" ]; then - qmake $3 QMAKE_CXXFLAGS+=-flto QMAKE_LFLAGS+=-flto CONFIG+=optimize_size || exit 1 - elif [ "$UPLATFORM" = "win32" ]; then - qmake $3 QMAKE_CXXFLAGS="-static -flto -Os" QMAKE_LFLAGS="-static -flto -Os" CONFIG+=optimize_size CONFIG+=staticlib CONFIG+=static || exit 1 + if [ "$PRECONFIGURED" != "1" ]; then + if [ "$3" != "" ]; then + # -flto is flawed on CI atm + if [ "$UPLATFORM" = "mac" ]; then + qmake $3 QMAKE_CXXFLAGS+=-flto QMAKE_LFLAGS+=-flto CONFIG+=optimize_size || exit 1 + elif [ "$UPLATFORM" = "win32" ]; then + qmake $3 QMAKE_CXXFLAGS="-static -flto -Os" QMAKE_LFLAGS="-static -flto -Os" CONFIG+=optimize_size CONFIG+=staticlib CONFIG+=static || exit 1 + else + qmake $3 CONFIG+=optimize_size || exit 1 + fi else - qmake $3 CONFIG+=optimize_size || exit 1 - fi - else - if [ "$UPLATFORM" = "mac" ]; then - cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-stdlib=libc++ -flto -Os -mmacosx-version-min=10.7" -DCMAKE_C_FLAGS="-flto -Os -mmacosx-version-min=10.7" || exit 1 - elif [ "$UPLATFORM" = "win32" ]; then - cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-static -Os" -DCMAKE_C_FLAGS="-static -Os" || exit 1 - else - cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Os" -DCMAKE_C_FLAGS="-Os" || exit 1 + if [ "$UPLATFORM" = "mac" ]; then + cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-stdlib=libc++ -flto -Os -mmacosx-version-min=10.7" -DCMAKE_C_FLAGS="-flto -Os -mmacosx-version-min=10.7" || exit 1 + elif [ "$UPLATFORM" = "win32" ]; then + cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-static -Os" -DCMAKE_C_FLAGS="-static -Os" || exit 1 + else + cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Os" -DCMAKE_C_FLAGS="-Os" || exit 1 + fi fi fi - make || exit 1 + if [ "$NOBUILD" != "1" ]; then + make || exit 1 - # Move the binary out of the dir - if [ "$UPLATFORM" = "win32" ] && [ -f "release/${1}${BINSUFFIX}" ]; then - mv "release/${1}${BINSUFFIX}" "${1}${BINSUFFIX}" || exit 1 - fi + # Move the binary out of the dir + if [ "$UPLATFORM" = "win32" ] && [ -f "release/${1}${BINSUFFIX}" ]; then + mv "release/${1}${BINSUFFIX}" "${1}${BINSUFFIX}" || exit 1 + fi - # Archive - if [ "$1" = "UEFITool" ] && [ "$UPLATFORM" = "mac" ]; then - strip -x UEFITool.app/Contents/MacOS/UEFITool || exit 1 - zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" UEFITool.app ${4} || exit 1 - else - strip -x "${1}${BINSUFFIX}" || exit 1 - zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" "${1}${BINSUFFIX}" ${4} || exit 1 + # Archive + if [ "$1" = "UEFITool" ] && [ "$UPLATFORM" = "mac" ]; then + strip -x UEFITool.app/Contents/MacOS/UEFITool || exit 1 + zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" UEFITool.app ${4} || exit 1 + else + strip -x "${1}${BINSUFFIX}" || exit 1 + zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" "${1}${BINSUFFIX}" ${4} || exit 1 + fi fi # Return to parent