8 # The branches below must be a subset of the branches above
13 group: ${{ github.workflow }}-${{ github.ref }}
14 cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
19 runs-on: ubuntu-latest
23 security-events: write
27 uses: actions/checkout@v4
29 - name: Setup vcpkg caching
30 uses: actions/github-script@v7
33 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
34 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
35 core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
39 git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
40 ${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
42 - name: Install dependencies
44 echo "::group::Update apt"
48 echo "::group::Install dependencies"
49 sudo apt-get install -y --no-install-recommends \
51 libcurl4-openssl-dev \
63 echo "::group::Install vcpkg dependencies"
65 # Disable vcpkg integration, as we mostly use system libraries.
66 mv vcpkg.json vcpkg-disabled.json
68 # We only use breakpad from vcpkg, as its CMake files
69 # are a bit special. So the Ubuntu's variant doesn't work.
70 ${{ runner.temp }}/vcpkg/vcpkg install breakpad
74 DEBIAN_FRONTEND: noninteractive
82 cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake
85 - name: Initialize CodeQL
86 uses: github/codeql-action/init@v3
89 config-file: ./.github/codeql/codeql-config.yml
96 echo "Running on $(nproc) cores"
97 cmake --build . -j $(nproc)
100 - name: Perform CodeQL Analysis
101 uses: github/codeql-action/analyze@v3
103 category: /language:cpp
105 output: sarif-results
107 - name: Filter out table & generated code
108 uses: advanced-security/filter-sarif@v1
115 input: sarif-results/cpp.sarif
116 output: sarif-results/cpp.sarif
118 - name: Upload results
119 uses: github/codeql-action/upload-sarif@v3
121 sarif_file: sarif-results/cpp.sarif