|
| 1 | +--- |
| 2 | +name: Analysis - CodeQL |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - 'src/**' |
| 8 | + - '**.py' |
| 9 | + |
| 10 | +env: |
| 11 | + CMAKE_BUILD_PARALLEL_LEVEL: 2 |
| 12 | + MAKEFLAGS: '-j 2' |
| 13 | + NODE_OPTIONS: ' --max-old-space-size=8192 ' |
| 14 | + |
| 15 | +jobs: |
| 16 | + codeql: |
| 17 | + name: CodeQL |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: [ubuntu-20.04] |
| 24 | + language: ['cpp', 'python'] |
| 25 | + include: |
| 26 | + - language: cpp |
| 27 | + buildtype: linux-release |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout repository |
| 31 | + uses: actions/checkout@v3 |
| 32 | + |
| 33 | + - name: Initialize CodeQL |
| 34 | + uses: github/codeql-action/init@v2 |
| 35 | + with: |
| 36 | + languages: ${{ matrix.language }} |
| 37 | + |
| 38 | + - name: Install Linux Dependencies |
| 39 | + if: ${{ matrix.language == 'cpp' }} |
| 40 | + run: > |
| 41 | + sudo apt-get update && sudo apt-get install ccache libglew-dev libx11-dev linux-headers-$(uname -r) |
| 42 | +
|
| 43 | + - name: Switch to gcc-11 |
| 44 | + if: ${{ matrix.language == 'cpp' }} |
| 45 | + run: | |
| 46 | + sudo apt install gcc-11 g++-11 |
| 47 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 |
| 48 | + sudo update-alternatives --set gcc /usr/bin/gcc-11 |
| 49 | +
|
| 50 | + - name: CCache |
| 51 | + uses: hendrikmuhs/[email protected] |
| 52 | + with: |
| 53 | + max-size: "1G" |
| 54 | + key: ccache-${{ matrix.os }}-${{ matrix.buildtype }} |
| 55 | + restore-keys: | |
| 56 | + ccache-${{ matrix.os }} |
| 57 | +
|
| 58 | + - name: Restore artifacts, or setup vcpkg (do not install any package) |
| 59 | + if: ${{ matrix.language == 'cpp' }} |
| 60 | + uses: lukka/run-vcpkg@v10 |
| 61 | + with: |
| 62 | + vcpkgGitCommitId: 8d41d43e1f7f5933622b02e16430312da649361e |
| 63 | + |
| 64 | + - name: Get latest CMake and ninja |
| 65 | + if: ${{ matrix.language == 'cpp' }} |
| 66 | + uses: lukka/get-cmake@latest |
| 67 | + |
| 68 | + - name: Run CMake |
| 69 | + if: ${{ matrix.language == 'cpp' }} |
| 70 | + uses: lukka/run-cmake@v10 |
| 71 | + with: |
| 72 | + configurePreset: ${{ matrix.buildtype }} |
| 73 | + buildPreset: ${{ matrix.buildtype }} |
| 74 | + |
| 75 | + - name: Perform CodeQL Analysis |
| 76 | + uses: github/codeql-action/analyze@v2 |
0 commit comments