|
9 | 9 | # the `language` matrix defined below to confirm you have the correct set of |
10 | 10 | # supported CodeQL languages. |
11 | 11 | # |
12 | | -name: "CodeQL" |
| 12 | +name: "CodeQL Advanced" |
13 | 13 |
|
14 | 14 | on: |
15 | 15 | push: |
16 | 16 | branches: [ "master" ] |
17 | 17 | pull_request: |
18 | | - # The branches below must be a subset of the branches above |
19 | 18 | branches: [ "master" ] |
20 | 19 | schedule: |
21 | | - - cron: '44 9 * * 6' |
| 20 | + - cron: '24 4 * * 6' |
22 | 21 |
|
23 | 22 | jobs: |
24 | 23 | analyze: |
25 | | - name: Analyze |
26 | | - runs-on: ubuntu-latest |
| 24 | + name: Analyze (${{ matrix.language }}) |
| 25 | + # Runner size impacts CodeQL analysis time. To learn more, please see: |
| 26 | + # - https://gh.io/recommended-hardware-resources-for-running-codeql |
| 27 | + # - https://gh.io/supported-runners-and-hardware-resources |
| 28 | + # - https://gh.io/using-larger-runners (GitHub.com only) |
| 29 | + # Consider using larger runners or machines with greater resources for possible analysis time improvements. |
| 30 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
27 | 31 | permissions: |
| 32 | + # required for all workflows |
| 33 | + security-events: write |
| 34 | + |
| 35 | + # required to fetch internal or private CodeQL packs |
| 36 | + packages: read |
| 37 | + |
| 38 | + # only required for workflows in private repositories |
28 | 39 | actions: read |
29 | 40 | contents: read |
30 | | - security-events: write |
31 | 41 |
|
32 | 42 | strategy: |
33 | 43 | fail-fast: false |
34 | 44 | matrix: |
35 | | - language: [ 'cpp' ] |
36 | | - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] |
37 | | - # Use only 'java' to analyze code written in Java, Kotlin or both |
38 | | - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both |
39 | | - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
40 | | - |
| 45 | + include: |
| 46 | + - language: actions |
| 47 | + build-mode: none |
| 48 | + - language: c-cpp |
| 49 | + build-mode: manual |
| 50 | + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' |
| 51 | + # Use `c-cpp` to analyze code written in C, C++ or both |
| 52 | + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both |
| 53 | + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both |
| 54 | + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, |
| 55 | + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. |
| 56 | + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how |
| 57 | + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages |
41 | 58 | steps: |
42 | 59 | - name: Checkout repository |
43 | 60 | uses: actions/checkout@v4 |
44 | 61 |
|
| 62 | + # Add any setup steps before running the `github/codeql-action/init` action. |
| 63 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` |
| 64 | + # or others). This is typically only required for manual builds. |
| 65 | + # - name: Setup runtime (example) |
| 66 | + # uses: actions/setup-example@v1 |
| 67 | + |
45 | 68 | # Initializes the CodeQL tools for scanning. |
46 | 69 | - name: Initialize CodeQL |
47 | 70 | uses: github/codeql-action/init@v3 |
48 | 71 | with: |
49 | 72 | languages: ${{ matrix.language }} |
| 73 | + build-mode: ${{ matrix.build-mode }} |
50 | 74 | # If you wish to specify custom queries, you can do so here or in a config file. |
51 | 75 | # By default, queries listed here will override any specified in a config file. |
52 | 76 | # Prefix the list here with "+" to use these queries and those in the config file. |
53 | 77 |
|
54 | | - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 78 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
55 | 79 | # queries: security-extended,security-and-quality |
56 | 80 |
|
57 | | - |
58 | | - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). |
59 | | - # If this step fails, then you should remove it and run the build manually (see below) |
60 | | - #- name: Autobuild |
61 | | - # uses: github/codeql-action/autobuild@v2 |
62 | | - |
63 | | - - name: Configure CMake |
64 | | - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
65 | | - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
66 | | - run: cmake -DTEST=ON -DEXAMPLES=ON -DBENCHMARK=ON -B ${{github.workspace}}/build |
67 | | - |
68 | | - - name: Build |
69 | | - # Build your program with the given configuration |
70 | | - run: cmake --build ${{github.workspace}}/build |
71 | | - |
| 81 | + # If the analyze step fails for one of the languages you are analyzing with |
| 82 | + # "We were unable to automatically build your code", modify the matrix above |
| 83 | + # to set the build mode to "manual" for that language. Then modify this step |
| 84 | + # to build your code. |
72 | 85 | # ℹ️ Command-line programs to run using the OS shell. |
73 | 86 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
74 | | - |
75 | | - # If the Autobuild fails above, remove it and uncomment the following three lines. |
76 | | - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
77 | | - |
78 | | - # - run: | |
79 | | - # echo "Run, Build Application using script" |
80 | | - # ./location_of_script_within_repo/buildscript.sh |
| 87 | + - if: matrix.build-mode == 'manual' |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + cmake -DTEST=ON -DEXAMPLES=ON -DBENCHMARK=ON -B ${{github.workspace}}/build |
| 91 | + cmake --build ${{github.workspace}}/build |
81 | 92 |
|
82 | 93 | - name: Perform CodeQL Analysis |
83 | 94 | uses: github/codeql-action/analyze@v3 |
|
0 commit comments