codeql.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # See https://codeql.github.com/ for details on CodeQL.
  2. #
  3. name: "CodeQL"
  4. on:
  5. push:
  6. branches: [ "master" ]
  7. pull_request:
  8. # The branches below must be a subset of the branches above
  9. branches: [ "master" ]
  10. schedule:
  11. - cron: '30 10 * * 2'
  12. jobs:
  13. analyze:
  14. name: Analyze
  15. # Runner size impacts CodeQL analysis time. To learn more, please see:
  16. # - https://gh.io/recommended-hardware-resources-for-running-codeql
  17. # - https://gh.io/supported-runners-and-hardware-resources
  18. # - https://gh.io/using-larger-runners
  19. # Consider using larger runners for possible analysis time improvements.
  20. runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
  21. timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
  22. permissions:
  23. actions: read
  24. contents: read
  25. security-events: write
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. language: [ 'c-cpp' ]
  30. # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
  31. # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
  32. # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
  33. # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
  34. steps:
  35. - name: Checkout repository
  36. uses: actions/checkout@v3
  37. # Initializes the CodeQL tools for scanning.
  38. - name: Initialize CodeQL
  39. uses: github/codeql-action/init@v3
  40. with:
  41. languages: ${{ matrix.language }}
  42. # If you wish to specify custom queries, you can do so here or in a config file.
  43. # By default, queries listed here will override any specified in a config file.
  44. # Prefix the list here with "+" to use these queries and those in the config file.
  45. # 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
  46. # queries: security-extended,security-and-quality
  47. - name: Install dependencies
  48. run: sudo apt-get -o Acquire::Retries=3 update && sudo apt-get -o Acquire::Retries=3 -y install tzdata make apt-file software-properties-common libssl-dev build-essential autotools-dev autoconf automake pkgconf libboost-all-dev gperf libevent-dev uuid-dev sphinx-doc sphinx-common libhiredis-dev gcc g++
  49. - name: Build gearmand
  50. run: |
  51. ./bootstrap.sh -a
  52. CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS"
  53. export CXXFLAGS
  54. ./configure --enable-ssl
  55. gcc --version
  56. make
  57. - name: Perform CodeQL Analysis
  58. uses: github/codeql-action/analyze@v3
  59. with:
  60. category: "/language:${{matrix.language}}"