|
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 2 | +# For most projects, this workflow file will not need changing; you simply need |
| 3 | +# to commit it to your repository. |
| 4 | +# |
| 5 | +# You may wish to alter this file to override the set of languages analyzed, |
| 6 | +# or to provide custom queries or build logic. |
| 7 | +name: "CodeQL" |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: [develop, master] |
| 12 | + pull_request: |
| 13 | + # The branches below must be a subset of the branches above |
| 14 | + branches: [develop] |
| 15 | + schedule: |
| 16 | + - cron: '0 12 * * 6' |
| 17 | + |
| 18 | +jobs: |
| 19 | + analyze: |
| 20 | + name: Analyze |
| 21 | + runs-on: ${{ matrix.config.os }} |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + # Override automatic language detection by changing the below list |
| 26 | + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] |
| 27 | + language: ['cpp'] |
| 28 | + # Learn more... |
| 29 | + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection |
| 30 | + config: |
| 31 | + - { |
| 32 | + name: "Windows MSVC x64", |
| 33 | + os: windows-latest, |
| 34 | + cc: "cl.exe", |
| 35 | + cxx: "cl.exe", |
| 36 | + arch: "x64", |
| 37 | + meson_opts: "-Db_vscrt=static_from_buildtype" |
| 38 | + } |
| 39 | + - { |
| 40 | + name: "Windows MSVC x86", |
| 41 | + os: windows-latest, |
| 42 | + cc: "cl.exe", |
| 43 | + cxx: "cl.exe", |
| 44 | + arch: "x64_x86", |
| 45 | + meson_opts: "-Db_vscrt=static_from_buildtype" |
| 46 | + } |
| 47 | + - { |
| 48 | + name: "Ubuntu GCC", |
| 49 | + os: ubuntu-latest, |
| 50 | + cc: "gcc", |
| 51 | + cxx: "g++" |
| 52 | + } |
| 53 | + - { |
| 54 | + name: "Ubuntu Clang", |
| 55 | + os: ubuntu-latest, |
| 56 | + cc: "clang", |
| 57 | + cxx: "clang++" |
| 58 | + } |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: Checkout repository |
| 62 | + uses: actions/checkout@v5 |
| 63 | + with: |
| 64 | + # We must fetch at least the immediate parents so that if this is |
| 65 | + # a pull request then we can checkout the head. |
| 66 | + fetch-depth: 2 |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + - name: Settings vars for MSVC |
| 70 | + if: startsWith(matrix.config.name, 'Windows MSVC') |
| 71 | + uses: ilammy/msvc-dev-cmd@v1 |
| 72 | + with: |
| 73 | + arch: ${{ matrix.config.arch }} |
| 74 | + |
| 75 | + # If this run was triggered by a pull request event, then checkout |
| 76 | + # the head of the pull request instead of the merge commit. |
| 77 | + # - run: git checkout HEAD^2 |
| 78 | + # if: ${{ github.event_name == 'pull_request' }} |
| 79 | + |
| 80 | + # Initializes the CodeQL tools for scanning. |
| 81 | + - name: Initialize CodeQL |
| 82 | + uses: github/codeql-action/init@v4 |
| 83 | + with: |
| 84 | + languages: ${{ matrix.language }} |
| 85 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 86 | + # By default, queries listed here will override any specified in a config file. |
| 87 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 88 | + # queries: ./path/to/local/query, your-org/your-repo/queries@main |
| 89 | + |
| 90 | + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 91 | + # If this step fails, then you should remove it and run the build manually (see below) |
| 92 | + #- name: Autobuild |
| 93 | + # uses: github/codeql-action/autobuild@v1 |
| 94 | + |
| 95 | + # ℹ️ Command-line programs to run using the OS shell. |
| 96 | + # 📚 https://git.io/JvXDl |
| 97 | + |
| 98 | + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines |
| 99 | + # and modify them (or add more) to build your code if your project |
| 100 | + # uses a compiled language |
| 101 | + |
| 102 | + - name: Configuring and compiling with meson |
| 103 | + env: |
| 104 | + CC: ${{ matrix.config.cc }} |
| 105 | + CXX: ${{ matrix.config.cxx }} |
| 106 | + run: | |
| 107 | + pip install meson ninja |
| 108 | + meson setup build -Dprefix=/ -Dmandir=/man -Dbindir=/ ${{ matrix.config.meson_opts }} --buildtype=release |
| 109 | +
|
| 110 | + - name: Perform CodeQL Analysis |
| 111 | + uses: github/codeql-action/analyze@v4 |
0 commit comments