codeql.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: "CodeQL"
  2. on:
  3. schedule:
  4. - cron: '33 14 * * 4'
  5. workflow_dispatch:
  6. inputs:
  7. ref:
  8. required: false
  9. jobs:
  10. analyze:
  11. name: Analyze
  12. runs-on: ubuntu-latest
  13. timeout-minutes: 360
  14. permissions:
  15. actions: read
  16. contents: read
  17. security-events: write
  18. container:
  19. image: ghcr.io/emqx/emqx-builder/5.1-4:1.14.5-25.3.2-2-ubuntu22.04
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. language: [ 'cpp', 'python' ]
  24. steps:
  25. - name: Checkout repository
  26. uses: actions/checkout@v3
  27. with:
  28. ref: ${{ github.event.inputs.ref }}
  29. - name: Ensure git safe dir
  30. run: |
  31. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  32. make ensure-rebar3
  33. - name: Initialize CodeQL
  34. uses: github/codeql-action/init@v2
  35. with:
  36. languages: ${{ matrix.language }}
  37. - name: Build
  38. if: matrix.language == 'cpp'
  39. env:
  40. PROFILE: emqx-enterprise
  41. run: |
  42. make emqx-enterprise-compile
  43. - name: Fetch deps
  44. if: matrix.language == 'python'
  45. env:
  46. PROFILE: emqx-enterprise
  47. run: |
  48. make deps-emqx-enterprise
  49. - name: Perform CodeQL Analysis
  50. uses: github/codeql-action/analyze@v2
  51. with:
  52. category: "/language:${{matrix.language}}"