From 558c1a3ed5343faf1692f87c7bbcdcd89de00a32 Mon Sep 17 00:00:00 2001 From: nauta Date: Wed, 27 Sep 2023 11:05:04 +0800 Subject: [PATCH] enable codeql workflow --- .github/workflows/codeql.yml | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 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 0000000000..9ab03b1c4a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,59 @@ +name: CodeQL + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 20480 # reserve for CodeQL + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-docker-images: 'true' + + - name: Install ubuntu environment + shell: bash + run: | + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update + sudo apt-get install -y git wget rpm rpm2cpio cpio make build-essential binutils m4 libtool-bin libncurses5 + + - uses: actions/checkout@v3 + + - name: Cache deps + id: cache-deps + uses: actions/cache@v3 + env: + cache-name: cache-deps + with: + key: ${{ runner.os }}-build-${{ env.cache-name }}-el9.x86_64-${{ hashFiles('deps/init/oceanbase.el9.x86_64.deps') }} + path: deps/3rd + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: cpp + + - name: Build init + run: | + bash build.sh init + + - name: Build project + shell: bash + run: | + rm -rf build_debug + bash build.sh debug + cd build_debug && make -j4 && cd - + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:cpp"