enable codeql workflow

This commit is contained in:
nauta
2023-09-27 11:05:04 +08:00
committed by GitHub
parent 8f6d380ccd
commit 558c1a3ed5

59
.github/workflows/codeql.yml vendored Normal file
View File

@ -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"