codeql.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. name: "CodeQL"
  2. on:
  3. schedule:
  4. - cron: '33 14 * * 4'
  5. workflow_dispatch:
  6. permissions:
  7. contents: read
  8. jobs:
  9. init:
  10. if: github.repository == 'emqx/emqx'
  11. runs-on: ubuntu-22.04
  12. outputs:
  13. BUILDER_master: ${{ steps.env.outputs.BUILDER_master }}
  14. BUILDER_release-58: ${{ steps.env.outputs.BUILDER_release-58 }}
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. branch:
  19. - master
  20. - release-58
  21. steps:
  22. - name: Checkout repository
  23. uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
  24. with:
  25. ref: ${{ matrix.branch }}
  26. - name: Read env.sh
  27. id: env
  28. run: |
  29. source env.sh
  30. echo "BUILDER_${{ matrix.branch }}=$EMQX_BUILDER" >> "$GITHUB_OUTPUT"
  31. analyze:
  32. if: github.repository == 'emqx/emqx'
  33. runs-on: ubuntu-22.04
  34. timeout-minutes: 360
  35. permissions:
  36. actions: read
  37. security-events: write
  38. needs: init
  39. container: ${{ needs.init.outputs[format('BUILDER_{0}', matrix.branch)] }}
  40. strategy:
  41. fail-fast: false
  42. matrix:
  43. branch:
  44. - master
  45. - release-58
  46. language:
  47. - cpp
  48. - python
  49. steps:
  50. - name: Checkout repository
  51. uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
  52. with:
  53. ref: ${{ matrix.branch }}
  54. - name: Ensure git safe dir
  55. run: |
  56. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  57. make ensure-rebar3
  58. - name: Initialize CodeQL
  59. uses: github/codeql-action/init@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5
  60. with:
  61. languages: ${{ matrix.language }}
  62. - name: Build
  63. if: matrix.language == 'cpp'
  64. env:
  65. PROFILE: emqx-enterprise
  66. run: |
  67. make emqx-enterprise-compile
  68. - name: Fetch deps
  69. if: matrix.language == 'python'
  70. env:
  71. PROFILE: emqx-enterprise
  72. run: |
  73. make deps-emqx-enterprise
  74. - name: Perform CodeQL Analysis
  75. uses: github/codeql-action/analyze@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5
  76. with:
  77. category: "/language:${{matrix.language}}"