Skip to content

Commit

Permalink
Use github code scanning instead of LGTM (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushilongbuaa authored and yxieca committed Jan 4, 2023
1 parent 8a276c6 commit d03b95d
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: "CodeQL config"
queries:
- uses: security-and-quality
- uses: security-extended
83 changes: 83 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# For more infomation, please visit: https://github.com/github/codeql-action

name: "CodeQL"

on:
push:
branches:
- 'master'
- '202[0-9][0-9][0-9]'
pull_request_target:
branches:
- 'master'
- '202[0-9][0-9][0-9]'
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
security-events: write

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

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2.1.29
with:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}

- if: matrix.language == 'cpp'
name: prepare
run: |
sudo apt-get update
sudo apt-get install -y libxml-simple-perl \
aspell \
aspell-en \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
libyang-dev \
libzmq3-dev \
libzmq5 \
swig3.0 \
libpython2.7-dev \
libgtest-dev \
libgmock-dev \
libboost1.71-dev \
libboost-serialization1.71-dev \
dh-exec \
doxygen \
cdbs \
bison \
flex \
graphviz \
autoconf-archive \
uuid-dev \
libjansson-dev \
python
- if: matrix.language == 'cpp'
name: build-swss-common
run: |
set -x
./autogen.sh
fakeroot dpkg-buildpackage -us -uc -b
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2.1.29
with:
category: "/language:${{matrix.language}}"

0 comments on commit d03b95d

Please sign in to comment.