Skip to content

scan-codeql-workflow #116

scan-codeql-workflow

scan-codeql-workflow #116

Workflow file for this run

name: scan-codeql-workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '15 0 * * *'
env:
TZ: "Europe/Warsaw"
BUILD_TYPE: "Release"
DEBIAN_FRONTEND: "noninteractive"
FFMPEG_COMMIT_ID: "n6.1.1"
BUILD_DIR: "${{ github.workspace }}/build"
PREFIX: "${{ github.workspace }}/_install"
defaults:
run:
shell: bash
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
analyze:
name: 'scan-codeql-workflow-analyze'
runs-on: ${{ matrix.runner-os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
runner-os: [ 'ubuntu-22.04' ]
permissions:
actions: read
security-events: write
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit
- name: 'Checkout repository'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: 'Install OS level dependencies'
run: |
set -exo pipefail && \
mkdir -p "${PREFIX}" "${BUILD_DIR}/ffmpeg" && \
sudo apt-get update --fix-missing && \
sudo apt-get full-upgrade -y && \
sudo apt-get install --no-install-recommends -y \
build-essential \
ca-certificates \
cmake \
diffutils \
gpg \
libx264-dev \
libx265-dev \
llvm \
m4 \
meson \
nasm \
ocl-icd-opencl-dev \
opencl-headers \
zlib1g-dev \
make curl git sudo tar unzip wget yasm
- name: 'Install Intel OneAPI APT repository'
run: |
set -exo pipefail && \
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 && \
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 && \
sudo apt-get update --fix-missing && \
sudo apt-get install --no-install-recommends -y intel-oneapi-ipp-devel-2022.0
- name: 'Download and patch ffmpeg repository'
run: |
set -exo pipefail && \
curl -Lf https://github.com/ffmpeg/ffmpeg/archive/${FFMPEG_COMMIT_ID}.tar.gz | tar -zx --strip-components=1 -C "${BUILD_DIR}/ffmpeg"
patch -d "${BUILD_DIR}/ffmpeg" -p1 -i <(cat "${{ github.workspace }}/ffmpeg/"*.patch)
cp "${{ github.workspace }}/ffmpeg/vf_raisr"*.c "${BUILD_DIR}/ffmpeg/libavfilter"
- name: 'Initialize CodeQL action'
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
languages: "c-cpp"
config-file: "${{ github.workspace }}/.github/codeql/codeql-config.yml"
- name: 'Build RAISR from source code'
run: |
"${{ github.workspace }}/build.sh" -DENABLE_RAISR_OPENCL=ON \
-DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \
-DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \
-DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp"
- name: 'Perform CodeQL Analysis'
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
category: "/language:c-cpp"