Skip to content

Commit

Permalink
[CP-Sec] Create codeql.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
carlewis committed May 23, 2024
1 parent ce10e06 commit 67a3c8c
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "CodeQL"

on:
push:
branches: [ "sycl-develop" ]
pull_request:
branches: [ "sycl-develop" ]
schedule:
- cron: '23 5 * * 5'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 360
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
- language: python
build-mode: none

container:
image: nvidia/cuda:12.4.1-devel-ubuntu22.04

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Install dependencies
if: matrix.build-mode == 'none'
shell: bash
run: |
apt update && apt install -y python3
- name: Build
if: matrix.build-mode == 'manual'
shell: bash
run: |
apt update && apt install -y cmake git libstdc++-12-dev ninja-build python3 wget && \
pushd /usr/local && \
wget -q https://github.com/intel/llvm/releases/download/nightly-2024-05-22/sycl_linux.tar.gz && \
tar -xf sycl_linux.tar.gz && \
export PATH=/usr/local/bin/:$PATH && \
export C_INCLUDE_PATH=/usr/local/include/:$C_INCLUDE_PATH && \
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH && \
export CC=clang && \
export CXX=clang++ && \
popd && \
cmake -G Ninja \
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
-DCUTLASS_ENABLE_SYCL=ON \
-DDPCPP_SYCL_TARGET=nvptx64-nvidia-cuda \
-DDPCPP_SYCL_ARCH=sm_80 && \
cmake --build .
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 67a3c8c

Please sign in to comment.