From 7a2bc0ce4a3f462a44639f00aa75353e1feb577a Mon Sep 17 00:00:00 2001 From: chenyufeifei Date: Wed, 15 Nov 2023 12:30:29 +0800 Subject: [PATCH] . --- .github/workflows/codeql.yml | 100 +++++++++++++++++++++++++++++++++++ 1 file changed, 100 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..c54e46e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,100 @@ +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' ] + compiler: + - gcc-11 + generator: + - "Ninja Multi-Config" + build_type: + - Debug + developer_mode: + - OFF + + 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: | + cmake -S . -B ./build \ + -G "${{matrix.generator}}" \ + -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \ + -DENABLE_DEVELOPER_MODE:BOOL=${{matrix.developer_mode}} \ + -DOPT_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} \ + -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DTRITON_ENABLE_GCS=true \ + -DTRITON_ENABLE_AZURE_STORAGE=true \ + -DTRITON_ENABLE_S3=true \ + + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Build + run: | + cmake --build ./build --config ${{matrix.build_type}} \ + -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DTRITON_ENABLE_GCS=true \ + -DTRITON_ENABLE_AZURE_STORAGE=true \ + -DTRITON_ENABLE_S3=true \ + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file