codeql-analysis.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: "CodeQL"
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. # The branches below must be a subset of the branches above
  7. branches: [main]
  8. permissions:
  9. contents: read
  10. jobs:
  11. CodeQL-Build:
  12. permissions:
  13. actions: read # for github/codeql-action/init to get workflow details
  14. contents: read # for actions/checkout to fetch code
  15. security-events: write # for github/codeql-action/autobuild to send a status report
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Harden the runner (Audit all outbound calls)
  19. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  20. with:
  21. egress-policy: audit
  22. - name: Checkout repository
  23. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  24. with:
  25. submodules: 'recursive'
  26. - name: Remove Third_party Modules from Code Scan
  27. run: |
  28. rm -rf third_party
  29. - name: Setup
  30. env:
  31. CC: /usr/bin/gcc-12
  32. CXX: /usr/bin/g++-12
  33. GOOGLETEST_VERSION: 1.12.1
  34. run: |
  35. sudo -E ./ci/setup_googletest.sh
  36. sudo -E ./ci/setup_ci_environment.sh
  37. - name: Initialize CodeQL
  38. uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
  39. with:
  40. languages: cpp
  41. - name: Autobuild
  42. uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
  43. - name: Perform CodeQL Analysis
  44. uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18