You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
proxysql/.github/workflows/ci-codeql.yml

82 lines
2.4 KiB

name: CI-codeql
on:
# push:
# branches: [ v2.x ]
# paths-ignore:
# - '.github/**'
# - '**.md'
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ v2.x ]
# paths-ignore:
# - '.github/**'
# - '**.md'
# schedule:
# - cron: '15 13 * * 3'
workflow_dispatch:
workflow_call:
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref_name }}
# cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- name: Update
run: sudo apt-get update
- name: Install build tools
run: sudo apt-get -y install make automake git wget gcc g++ libtool equivs python3
- name: Install build dependencies
run: sudo apt-get -y install libssl-dev gnutls-dev libgnutls28-dev libmysqlclient-dev libboost-all-dev libunwind8 libunwind-dev uuid-dev ca-certificates
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- if: matrix.language == 'python' || matrix.language == 'java'
name: Autobuild
uses: github/codeql-action/autobuild@v2
- if: matrix.language == 'cpp'
name: Git describe
env:
GH_TOKEN: ${{ github.token }}
run: |
export VERS=$(git ls-remote https://github.com/sysown/proxysql.git "refs/tags/*" | grep -v 'refs/tags/v' | sed -e 's|.*/||g' | tail -2 | head -1)
export HASH=$(gh api repos/sysown/proxysql/git/refs/heads/v2.x | jq '.object.sha' | cut -c2-8)
export CMTS=$(gh api repos/sysown/proxysql/compare/${VERS}...v2.x | jq '.ahead_by')
echo "git descibe : ${VERS}-${CMTS}-g${HASH}"
echo "GIT_VERSION=${VERS}-${CMTS}-g${HASH}" >> $GITHUB_ENV
- if: matrix.language == 'cpp'
name: Build C++
run: |
make -j$(nproc) clickhouse
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2