codeql.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: "CodeQL"
  2. on:
  3. push:
  4. branches: [ 'develop', 'release/2.7.x' ]
  5. pull_request:
  6. # The branches below must be a subset of the branches above
  7. branches: [ 'develop' ]
  8. schedule:
  9. - cron: '5 16 * * 3'
  10. jobs:
  11. analyze:
  12. name: Analyze
  13. runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
  14. timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
  15. permissions:
  16. actions: read
  17. contents: read
  18. security-events: write
  19. strategy:
  20. fail-fast: false
  21. matrix:
  22. language: [ 'cpp' ]
  23. # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
  24. # Use only 'java' to analyze code written in Java, Kotlin or both
  25. # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
  26. # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
  27. steps:
  28. - name: Checkout repository
  29. uses: actions/checkout@v4
  30. - if: matrix.language == 'cpp'
  31. name: Install dependencies
  32. run: |
  33. sudo apt update
  34. sudo apt install build-essential cmake g++
  35. sudo apt install qtbase5-dev qtbase5-private-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev libargon2-dev libkeyutils-dev libminizip-dev libbotan-2-dev libqrencode-dev zlib1g-dev asciidoctor libreadline-dev libpcsclite-dev libusb-1.0-0-dev libxi-dev libxtst-dev libqt5x11extras5-dev
  36. # Initializes the CodeQL tools for scanning.
  37. - name: Initialize CodeQL
  38. uses: github/codeql-action/init@v3
  39. with:
  40. languages: ${{ matrix.language }}
  41. # If you wish to specify custom queries, you can do so here or in a config file.
  42. # By default, queries listed here will override any specified in a config file.
  43. # Prefix the list here with "+" to use these queries and those in the config file.
  44. # 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
  45. queries: security-and-quality
  46. - if: matrix.language == 'cpp'
  47. name: Build C++
  48. run: |
  49. mkdir build && cd build
  50. cmake -DWITH_XC_ALL=ON -DWITH_TESTS=OFF ..
  51. make -j $(nproc)
  52. # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
  53. # If this step fails, then you should remove it and run the build manually (see below)
  54. - if: matrix.language != 'cpp'
  55. name: Autobuild
  56. uses: github/codeql-action/autobuild@v3
  57. - name: Perform CodeQL Analysis
  58. uses: github/codeql-action/analyze@v3
  59. with:
  60. category: "/language:${{matrix.language}}"