|
| 1 | +name: Coverity Build |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + branch: |
| 9 | + description: 'Branch to run scans on' |
| 10 | + default: 'main' |
| 11 | + type: string |
| 12 | + workflow_call: |
| 13 | + pull_request: |
| 14 | + branches: [ "main" ] |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | +env: |
| 20 | + COVERITY_PROJECT: 'Media-Entertainment-AI-Suite' |
| 21 | + COVERITY_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} |
| 22 | + COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |
| 23 | + DESCRIPTION: ${{ github.ref_name }} |
| 24 | + VERSION: ${{ github.sha }} |
| 25 | + DEBIAN_FRONTEND: noninteractive |
| 26 | +jobs: |
| 27 | + coverity-diff: |
| 28 | + runs-on: ubuntu-24.04 |
| 29 | + steps: |
| 30 | + - name: Checkout Repository |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + fetch-depth: 0 |
| 34 | + |
| 35 | + - name: Install FFmpeg Build Dependencies |
| 36 | + run: | |
| 37 | + sudo apt-get update && \ |
| 38 | + sudo apt-get install --no-install-recommends -y \ |
| 39 | + build-essential \ |
| 40 | + git autoconf \ |
| 41 | + automake \ |
| 42 | + libtool \ |
| 43 | + cmake \ |
| 44 | + yasm \ |
| 45 | + nasm \ |
| 46 | + pkg-config \ |
| 47 | + libx264-dev \ |
| 48 | + libx265-dev \ |
| 49 | + libass-dev \ |
| 50 | + libfreetype6-dev \ |
| 51 | + libsdl2-dev \ |
| 52 | + libvorbis-dev \ |
| 53 | + libvpx-dev && \ |
| 54 | + curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ |
| 55 | + curl -fsSL https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | sudo tee /usr/share/keyrings/intel-graphics-archive-keyring.gpg > /dev/null && \ |
| 56 | + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/intel-oneAPI.list && \ |
| 57 | + echo "deb [signed-by=/usr/share/keyrings/intel-graphics-archive-keyring.gpg arch=amd64] https://repositories.intel.com/graphics/ubuntu jammy flex" | sudo tee /etc/apt/sources.list.d/intel-graphics.list && \ |
| 58 | + sudo apt-get update --fix-missing && \ |
| 59 | + sudo apt-get install --no-install-recommends -y \ |
| 60 | + opencl-headers \ |
| 61 | + ocl-icd-opencl-dev \ |
| 62 | + intel-oneapi-ipp-devel-2022.0 |
| 63 | +
|
| 64 | + - name: Apt repos openvino install apt |
| 65 | + run: | |
| 66 | + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/openvino/2024 ubuntu22 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2024.list && \ |
| 67 | + sudo apt-get update && \ |
| 68 | + sudo apt-cache search openvino && \ |
| 69 | + sudo apt-get install -y openvino-2024.5.0 && \ |
| 70 | + sudo apt-get install -y --no-install-recommends --fix-missing \ |
| 71 | + ca-certificates tar g++ wget \ |
| 72 | + pkg-config nasm yasm libglib2.0-dev flex bison \ |
| 73 | + gobject-introspection libgirepository1.0-dev \ |
| 74 | + python3-dev libx11-dev libxv-dev libxt-dev libasound2-dev \ |
| 75 | + libpango1.0-dev libtheora-dev libvisual-0.4-dev libgl1-mesa-dev \ |
| 76 | + libcurl4-gnutls-dev librtmp-dev libx264-dev \ |
| 77 | + libx265-dev libde265-dev libva-dev libtbb-dev |
| 78 | +
|
| 79 | + - name: Download and Install Coverity Tools |
| 80 | + env: |
| 81 | + LANGUAGE: cxx |
| 82 | + run: | |
| 83 | + "${GITHUB_WORKSPACE}/.github/coverity/install_coverity.sh" |
| 84 | + echo "/opt/coverity/cxx/cov-analysis-linux64-2024.6.1/bin" >> "$GITHUB_PATH" |
| 85 | +
|
| 86 | + - name: Preparation of Baseline, build RAISR library |
| 87 | + shell: bash |
| 88 | + env: |
| 89 | + RAISR_REPO: "https://github.com/OpenVisualCloud/Video-Super-Resolution-Library" |
| 90 | + RAISR_BRANCH: "v23.11.1" |
| 91 | + run: | |
| 92 | + . "${GITHUB_WORKSPACE}/scripts/common.sh" && \ |
| 93 | + git_repo_download_strip_unpack "${RAISR_REPO}" "${RAISR_BRANCH}" "${GITHUB_WORKSPACE}/Video-Super-Resolution-Library" && \ |
| 94 | + "${GITHUB_WORKSPACE}/Video-Super-Resolution-Library/build.sh" -DENABLE_RAISR_OPENCL=ON \ |
| 95 | + -DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \ |
| 96 | + -DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \ |
| 97 | + -DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" |
| 98 | +
|
| 99 | + - name: Preparation of Baseline FFmpeg |
| 100 | + shell: bash |
| 101 | + env: |
| 102 | + FFMPEG_REPO: "https://github.com/FFmpeg/FFmpeg" |
| 103 | + FFMPEG_VERSION: "n7.1" |
| 104 | + run: | |
| 105 | + . "${GITHUB_WORKSPACE}/scripts/common.sh" && \ |
| 106 | + git_repo_download_strip_unpack "${FFMPEG_REPO}" "refs/tags/${FFMPEG_VERSION}" "${GITHUB_WORKSPACE}/ffmpeg" |
| 107 | +
|
| 108 | + - name: Build and Scan of Baseline FFmpeg |
| 109 | + shell: bash |
| 110 | + continue-on-error: true |
| 111 | + working-directory: "${{ github.workspace }}/ffmpeg" |
| 112 | + run: | |
| 113 | + ./configure \ |
| 114 | + --enable-opencl \ |
| 115 | + --disable-shared \ |
| 116 | + --disable-debug \ |
| 117 | + --disable-doc \ |
| 118 | + --enable-static \ |
| 119 | + --enable-gpl \ |
| 120 | + --enable-libx264 \ |
| 121 | + --enable-libx265 \ |
| 122 | + --enable-libass \ |
| 123 | + --enable-libfreetype \ |
| 124 | + --enable-libvorbis \ |
| 125 | + --enable-libvpx \ |
| 126 | + --enable-cross-compile \ |
| 127 | + --extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \ |
| 128 | + --extra-cflags="-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp -I/include" \ |
| 129 | + --extra-ldflags="-fopenmp -L/opt/intel/oneapi/ipp/latest/lib -L/lib -L/runtime/lib/intel64 -L/runtime/3rdparty/tbb/lib" && \ |
| 130 | + cov-build --dir cov-int-baseline make -j"$(nproc)" && \ |
| 131 | + tar -czf cov-baseline.tar.gz cov-int-baseline |
| 132 | +
|
| 133 | + - name: Apply RAISR Patch |
| 134 | + shell: bash |
| 135 | + run: | |
| 136 | + patch -d "${GITHUB_WORKSPACE}/ffmpeg" -p1 < "${GITHUB_WORKSPACE}/patches/"* |
| 137 | +
|
| 138 | + - name: Preparation for Patched FFmpeg |
| 139 | + shell: bash |
| 140 | + continue-on-error: true |
| 141 | + working-directory: ${{ github.workspace }}/ffmpeg |
| 142 | + run: | |
| 143 | + ./configure \ |
| 144 | + --enable-libipp \ |
| 145 | + --enable-opencl \ |
| 146 | + --disable-shared \ |
| 147 | + --disable-debug \ |
| 148 | + --disable-doc \ |
| 149 | + --enable-static \ |
| 150 | + --enable-gpl \ |
| 151 | + --enable-libx264 \ |
| 152 | + --enable-libx265 \ |
| 153 | + --enable-libass \ |
| 154 | + --enable-libfreetype \ |
| 155 | + --enable-libvorbis \ |
| 156 | + --enable-libvpx \ |
| 157 | + --enable-cross-compile \ |
| 158 | + --extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \ |
| 159 | + --extra-cflags="-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp -I/include" \ |
| 160 | + --extra-ldflags="-fopenmp -L/opt/intel/oneapi/ipp/latest/lib -L/lib -L/runtime/lib/intel64 -L/runtime/3rdparty/tbb/lib" && \ |
| 161 | + cov-build --dir cov-int-patched make -j"$(nproc)" && \ |
| 162 | + tar -czf cov-patched.tar.gz cov-int-patched |
| 163 | +
|
| 164 | + # - name: Preparation for system wide installation |
| 165 | + # run: | |
| 166 | + # mkdir -p /workspace/ivsr |
| 167 | + # set -e -o pipefail |
| 168 | + # apt-get update && \ |
| 169 | + # apt-get install -y --no-install-recommends --fix-missing \ |
| 170 | + # curl \ |
| 171 | + # ca-certificates \ |
| 172 | + # gpg-agent \ |
| 173 | + # software-properties-common \ |
| 174 | + # autoconf \ |
| 175 | + # automake \ |
| 176 | + # build-essential && \ |
| 177 | + # apt-get install -y --no-install-recommends --fix-missing \ |
| 178 | + # apt-utils \ |
| 179 | + # cmake cython3 flex \ |
| 180 | + # bison gcc g++ git make \ |
| 181 | + # patch pkg-config wget \ |
| 182 | + # libdrm-dev libudev-dev libtool libusb-1.0-0-dev \ |
| 183 | + # xz-utils ocl-icd-opencl-dev opencl-headers \ |
| 184 | + |
| 185 | +# Build iVSR SDK |
| 186 | +# cp -r ./ivsr_sdk ${WORKSPACE}/ivsr/ivsr_sdk |
| 187 | +# mkdir -p ${WORKSPACE}/ivsr/ivsr_sdk |
| 188 | +# mkdir -p build && cd build && \ |
| 189 | +# cmake .. -DENABLE_LOG=OFF -DENABLE_PERF=OFF -DENABLE_THREADPROCESS=ON -DCMAKE_BUILD_TYPE=Release && \ |
| 190 | +# make -j16 && \ |
| 191 | +# make install && \ |
| 192 | +# echo "Building iVSR SDK finished." |
| 193 | + |
| 194 | +# FFMPEG_REPO=https://github.com/FFmpeg/FFmpeg.git |
| 195 | +# FFMPEG_VERSION=n7.1 |
| 196 | +# FFMPEG_IVSR_SDK_PLUGIN_DIR=${WORKSPACE}/ivsr/ivsr_ffmpeg_plugin |
| 197 | + |
| 198 | +# mkdir -p ${FFMPEG_IVSR_SDK_PLUGIN_DIR}/ffmpeg && \ |
| 199 | +# cd ${FFMPEG_IVSR_SDK_PLUGIN_DIR}/ffmpeg || exit1 |
| 200 | +# git config --global user.email "noname@example.com" && \ |
| 201 | +# git config --global user.name "no name" && \ |
| 202 | +# git clone ${FFMPEG_REPO} . && \ |
| 203 | +# git checkout ${FFMPEG_VERSION} |
| 204 | + |
| 205 | +# COPY ./ivsr_ffmpeg_plugin/patches/*.patch ./ |
| 206 | +# for patch_file in $(find -iname "*.patch" | sort -n); do \ |
| 207 | +# echo "Applying: ${patch_file}"; \ |
| 208 | +# git am --whitespace=fix ${patch_file}; \ |
| 209 | +# done |
| 210 | + |
| 211 | +# ./configure \ |
| 212 | +# --enable-gpl \ |
| 213 | +# --enable-nonfree \ |
| 214 | +# --disable-static \ |
| 215 | +# --disable-doc \ |
| 216 | +# --enable-shared \ |
| 217 | +# --enable-version3 \ |
| 218 | +# --enable-libivsr \ |
| 219 | +# --enable-libx264 \ |
| 220 | +# --enable-libx265 && \ |
| 221 | +# make -j16 && \ |
| 222 | +# make install |
0 commit comments