|
| 1 | +name: scan-codeql-workflow |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +env: |
| 10 | + BUILD_TYPE: "Release" |
| 11 | + BUILD_DIR: "${{ github.workspace }}/_build" |
| 12 | + BUILD_UNIT_TESTS: "OFF" |
| 13 | + PREFIX_DIR: "${{ github.workspace }}/_install" |
| 14 | + MTL_BUILD_DISABLE_PCAPNG: true |
| 15 | + DEBIAN_FRONTEND: "noninteractive" |
| 16 | + TRY_CACHE_REFRESH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +concurrency: |
| 22 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
| 25 | +jobs: |
| 26 | + analyze: |
| 27 | + name: Analyze |
| 28 | + runs-on: ${{ matrix.runner-os }} |
| 29 | + timeout-minutes: 90 |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + runner-os: [ 'ubuntu-22.04' ] |
| 34 | + permissions: |
| 35 | + actions: read |
| 36 | + security-events: write |
| 37 | + defaults: |
| 38 | + run: |
| 39 | + shell: bash |
| 40 | + steps: |
| 41 | + - name: 'Harden Runner' |
| 42 | + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 |
| 43 | + with: |
| 44 | + egress-policy: audit |
| 45 | + |
| 46 | + - name: 'Checkout repository' |
| 47 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 48 | + |
| 49 | + - name: 'Install OS level dependencies' |
| 50 | + run: eval 'source scripts/setup_build_env.sh && install_package_dependencies' |
| 51 | + |
| 52 | + - name: 'Check local dependencies build cache' |
| 53 | + id: load-local-dependencies-cache |
| 54 | + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 |
| 55 | + with: |
| 56 | + path: ${{ env.BUILD_DIR }} |
| 57 | + key: ${{ runner.os }}-${{ hashFiles('versions.env') }}-${{ hashFiles('scripts/setup*.sh') }} |
| 58 | + |
| 59 | + - name: 'Download, unpack and patch build dependencies' |
| 60 | + if: steps.load-local-dependencies-cache.outputs.cache-hit != 'true' |
| 61 | + run: eval 'source scripts/setup_build_env.sh && get_download_unpack_dependencies' |
| 62 | + |
| 63 | + - name: 'Clone and patch ffmpeg 6.1 and 7.0' |
| 64 | + if: steps.load-local-dependencies-cache.outputs.cache-hit != 'true' |
| 65 | + run: | |
| 66 | + ffmpeg-plugin/clone-and-patch-ffmpeg.sh "6.1" |
| 67 | + ffmpeg-plugin/clone-and-patch-ffmpeg.sh "7.0" |
| 68 | +
|
| 69 | + - name: 'Build and Install xdp and libbpf' |
| 70 | + run: eval 'source scripts/setup_build_env.sh && lib_install_xdp_bpf_tools' |
| 71 | + |
| 72 | + - name: 'Build and Install libfabric' |
| 73 | + run: eval 'source scripts/setup_build_env.sh && lib_install_fabrics' |
| 74 | + |
| 75 | + - name: 'Build and Install the DPDK' |
| 76 | + run: eval 'source scripts/setup_build_env.sh && lib_install_dpdk' |
| 77 | + |
| 78 | + - name: 'Build and Install the MTL' |
| 79 | + run: eval 'source scripts/setup_build_env.sh && lib_install_mtl' |
| 80 | + |
| 81 | + - name: 'Build and Install JPEG XS' |
| 82 | + run: eval 'source scripts/setup_build_env.sh && lib_install_jpeg_xs' |
| 83 | + |
| 84 | + - name: 'Build and Install JPEG XS ffmpeg plugin' |
| 85 | + run: eval 'source scripts/setup_build_env.sh && lib_install_mtl_jpeg_xs_plugin' |
| 86 | + |
| 87 | + - name: 'Build gRPC and dependencies' |
| 88 | + run: eval 'source scripts/setup_build_env.sh && lib_install_grpc' |
| 89 | + |
| 90 | + - name: 'Save local dependencies build cache' |
| 91 | + if: env.TRY_CACHE_REFRESH == 'true' && steps.load-local-dependencies-cache.outputs.cache-hit != 'true' |
| 92 | + id: save-local-dependencies-cache |
| 93 | + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 |
| 94 | + with: |
| 95 | + path: ${{ env.BUILD_DIR }} |
| 96 | + key: ${{ runner.os }}-${{ hashFiles('versions.env') }}-${{ hashFiles('scripts/setup*.sh') }} |
| 97 | + |
| 98 | + - name: 'Initialize CodeQL' |
| 99 | + uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 |
| 100 | + with: |
| 101 | + languages: 'c-cpp' |
| 102 | + config-file: ${{ github.workspace }}/.github/codeql/codeql-config.yml |
| 103 | + |
| 104 | + - name: 'Build MCM SDK and Media Proxy' |
| 105 | + run: ./build.sh |
| 106 | + |
| 107 | + - name: 'Perform CodeQL Analysis' |
| 108 | + uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 |
| 109 | + with: |
| 110 | + category: "/language:c-cpp" |
0 commit comments