enable codeql workflow
This commit is contained in:
59
.github/workflows/codeql.yml
vendored
Normal file
59
.github/workflows/codeql.yml
vendored
Normal 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"
|
||||
Reference in New Issue
Block a user