CodeQL - 144/merge #261
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodeQL | |
| run-name: CodeQL - ${{ github.ref_name }} | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 7 * * 1' | |
| jobs: | |
| codeql: | |
| name: Analyze Code | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - languages: 'c' | |
| build_mode: 'manual' | |
| - languages: 'actions' | |
| build_mode: 'none' | |
| env: | |
| SCCACHE_DIR: ${{ github.workspace }}/sccache | |
| SCCACHE_LOG: "info" | |
| SCCACHE_ERROR_LOG: ${{ github.workspace }}/sccache-error.log | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| - name: Install Arm Toolchain | |
| if: matrix.build_mode == 'manual' | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: '12.2.Rel1' | |
| - name: Setup Shared Compilation Cache | |
| if: matrix.build_mode == 'manual' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.SCCACHE_DIR }} | |
| key: sccache-${{ github.workflow }}-${{ runner.os }}-${{ matrix.languages }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}-${{ github.event.pull_request.number || github.ref }} | |
| restore-keys: | | |
| sccache-${{ github.workflow }}-${{ runner.os }}-${{ matrix.languages }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}- | |
| sccache-${{ github.workflow }}-${{ runner.os }}-${{ matrix.languages }}- | |
| - name: Setup Shared Compilation Cache | |
| if: matrix.build_mode == 'manual' | |
| uses: mozilla-actions/sccache-action@v0.0.9 | |
| - name: Setup Trap Cache Directory | |
| if: matrix.build_mode == 'manual' | |
| run: mkdir -p /home/runner/work/_temp/trapCaches/cpp/tarballs | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: ${{ matrix.languages }} | |
| build-mode: ${{ matrix.build_mode }} | |
| - name: Build CodeQL Database | |
| if: matrix.build_mode == 'manual' | |
| run: CMAKE_C_COMPILER_LAUNCHER=sccache make all -j | |
| - name: Analyze CodeQL | |
| id: analyze | |
| uses: github/codeql-action/analyze@v4 | |
| - name: Upload Analysis Results | |
| if: always() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: codeql-${{ matrix.languages }} | |
| path: ${{ steps.analyze.outputs.sarif-output }} | |
| retention-days: 2 |