|
| 1 | +name: "CodeQL Advanced" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "master" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "master" ] |
| 8 | + schedule: |
| 9 | + - cron: '40 22 * * 4' |
| 10 | + |
| 11 | +jobs: |
| 12 | + analyze: |
| 13 | + name: Analyze (${{ matrix.language }}) |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + permissions: |
| 17 | + security-events: write |
| 18 | + packages: read |
| 19 | + actions: read |
| 20 | + contents: read |
| 21 | + |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + include: |
| 26 | + - language: actions |
| 27 | + build-mode: none |
| 28 | + - language: c-cpp |
| 29 | + build-mode: manual |
| 30 | + |
| 31 | + steps: |
| 32 | + ########################################################################### |
| 33 | + # 1. CHECKOUT |
| 34 | + ########################################################################### |
| 35 | + - name: Checkout repository |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + fetch-depth: 0 |
| 39 | + submodules: recursive |
| 40 | + |
| 41 | + ########################################################################### |
| 42 | + # 2. INSTALL TOOLCHAIN |
| 43 | + ########################################################################### |
| 44 | + - name: Install toolchain |
| 45 | + id: install-toolchain |
| 46 | + uses: stormbytepp/githubactions/.github/actions/install-toolchain@master |
| 47 | + with: |
| 48 | + toolchain: clang |
| 49 | + |
| 50 | + ########################################################################### |
| 51 | + # 4. INITIALIZE CODEQL |
| 52 | + ########################################################################### |
| 53 | + - name: Initialize CodeQL |
| 54 | + uses: github/codeql-action/init@v4 |
| 55 | + with: |
| 56 | + languages: ${{ matrix.language }} |
| 57 | + build-mode: ${{ matrix.build-mode }} |
| 58 | + |
| 59 | + ########################################################################### |
| 60 | + # 5. BUILD WITH CMAKE (solo para C/C++ con build-mode manual) |
| 61 | + ########################################################################### |
| 62 | + - name: Build with CMake |
| 63 | + if: matrix.language == 'c-cpp' && matrix.build-mode == 'manual' |
| 64 | + uses: ashutoshvarma/action-cmake-build@master |
| 65 | + with: |
| 66 | + build-dir: ${{ github.workspace }}/build |
| 67 | + cc: ${{ steps.install-toolchain.outputs.c_compiler }} |
| 68 | + cxx: ${{ steps.install-toolchain.outputs.cxx_compiler }} |
| 69 | + configure-options: >- |
| 70 | + -G Ninja |
| 71 | + -DENABLE_ASAN=ON |
| 72 | + -DENABLE_TEST=ON |
| 73 | + build-type: Debug |
| 74 | + run-test: false |
| 75 | + |
| 76 | + ########################################################################### |
| 77 | + # 6. PERFORM CODEQL ANALYSIS |
| 78 | + ########################################################################### |
| 79 | + - name: Perform CodeQL Analysis |
| 80 | + uses: github/codeql-action/analyze@v4 |
| 81 | + with: |
| 82 | + category: "/language:${{ matrix.language }}" |
0 commit comments