Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CodeQL Analysis workflow #16

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: "CodeQL"

on:
push:
branches: [ main, release-* ]
paths-ignore: [ '**.md', '**.png', '**.jpg', '**.svg', '**/docs/**' ]
pull_request:
branches: [ main, release-* ]
paths-ignore: [ '**.md', '**.png', '**.jpg', '**.svg', '**/docs/**' ]
schedule:
- cron: '0 4 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

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

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential \
cmake \
git \
curl \
zip \
unzip \
tar \
pkg-config \
python3

- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/bootstrap-vcpkg.sh

- name: Cache vcpkg packages
uses: actions/cache/restore@v3
with:
path: /home/runner/vcpkg/installed
key: Linux-vcpkg-${{ hashFiles('**/CMakeLists.txt') }}

- name: Install project dependencies with vcpkg
run: |
$HOME/vcpkg/vcpkg install re2
$HOME/vcpkg/vcpkg install aws-sdk-cpp
$HOME/vcpkg/vcpkg install google-cloud-cpp[storage]
$HOME/vcpkg/vcpkg install azure-storage-blobs-cpp
$HOME/vcpkg/vcpkg install rapidjson

- name: Cache vcpkg packages
uses: actions/cache/save@v3
with:
path: /home/runner/vcpkg
key: Linux-vcpkg-${{ hashFiles('**/CMakeLists.txt') }}

- name: Build repository agent
run: |
mkdir -p $HOME/build
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DTRITON_ENABLE_GCS=true \
-DTRITON_ENABLE_AZURE_STORAGE=true \
-DTRITON_ENABLE_S3=true \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Build
run: |
cmake --build ./build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Loading