diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..6d3ba2f9 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,71 @@ +name: "CodeQL Security Scanning" + +on: + push: + branches: + - develop + - mainline + - candidate + pull_request: + branches: + - develop + - mainline + schedule: + # Weekly scan on Fridays at 6:34 PM UTC + - cron: '34 18 * * 5' + +jobs: + analyze: + name: Analyze (C/C++) + runs-on: ubuntu-latest + container: rocm/dev-ubuntu-22.04:latest + permissions: + security-events: write + packages: read + actions: read + contents: read + + steps: + - name: Install OS requirements + timeout-minutes: 10 + run: | + apt update + apt install -y software-properties-common + apt-add-repository -y ppa:git-core/ppa + apt-get update + apt install -y git + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure Git Safe Directory + run: | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + + - name: Install dependencies + run: | + apt-get update + apt-get install -y build-essential cmake libnuma-dev + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: c-cpp + build-mode: manual + queries: security-extended + + - name: Build TransferBench + run: | + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_LOCAL_GPU_TARGET_ONLY=ON \ + -DENABLE_NIC_EXEC=OFF \ + -DENABLE_MPI_COMM=OFF \ + -DCMAKE_PREFIX_PATH=/opt/rocm + make -j $(nproc) + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:c-cpp"