From 2bae8fec6ad3d2120a1163b1547b1864f4cb4522 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 4 Jun 2024 08:09:13 +0800 Subject: [PATCH] Add SAST tool CodeQL scan Address OpenSSF "SAST" in #516 --- .github/workflows/codeql.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..9183ccf --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,52 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + + runs-on: ubuntu-latest + + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: manual + + steps: + - name: Checkout opencl-clang sources for action files + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: Run build-opencl-clang action + uses: ./.github/actions/build-opencl-clang + with: + ref_llvm: main + ref_translator: main + ref_opencl-clang: main + + - name: Initialize CodeQL + uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 + with: + category: "/language:${{matrix.language}}"