From 0c448a7546d8c540944ff34bc9225dde975cd863 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Fri, 14 Jul 2023 10:16:07 +0200 Subject: [PATCH] ci: add codeql workflow --- .github/workflows/codeql.yaml | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/codeql.yaml diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml new file mode 100644 index 000000000..6d4cc3dc4 --- /dev/null +++ b/.github/workflows/codeql.yaml @@ -0,0 +1,61 @@ +name: "CodeQL" + +on: + schedule: + - cron: '33 14 * * 4' + workflow_dispatch: + inputs: + ref: + required: false + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + container: + image: ghcr.io/emqx/emqx-builder/5.1-1:1.14.5-25.3.2-1-ubuntu22.04 + + strategy: + fail-fast: false + matrix: + language: [ 'cpp', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Ensure git safe dir + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + make ensure-rebar3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Build + if: matrix.language == 'cpp' + env: + PROFILE: emqx-enterprise + run: | + make emqx-enterprise-compile + + - name: Fetch deps + if: matrix.language == 'python' + env: + PROFILE: emqx-enterprise + run: | + make deps-emqx-enterprise + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}"