You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2026-10-23 21:28:58 +03:00
[CONC-786] add infer to CI
This commit is contained in:
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -35,6 +35,7 @@ jobs:
|
||||
|
||||
ci-server:
|
||||
name: server ${{ matrix.server.version }} test suite${{ matrix.server.ps && format(' {0}', matrix.server.ps) || '' }}
|
||||
needs: infer
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
@@ -170,3 +171,35 @@ jobs:
|
||||
srv: ${{ matrix.db-type }}
|
||||
MAXSCALE_TAG: ${{ matrix.maxscale-tag || '' }}
|
||||
MARIADB_PLUGIN_DIR: ${{ github.workspace }}
|
||||
|
||||
infer:
|
||||
name: Infer static analysis
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
INFER_VERSION: 1.3.0
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install build dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y libssl-dev
|
||||
|
||||
- name: Install Infer
|
||||
run: |
|
||||
curl -fsSL "https://github.com/facebook/infer/releases/download/v${INFER_VERSION}/infer-linux-x86_64-v${INFER_VERSION}.tar.xz" \
|
||||
| sudo tar -C /opt -xJ
|
||||
echo "/opt/infer-linux-x86_64-v${INFER_VERSION}/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Configure
|
||||
run: cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
|
||||
- name: Run Infer
|
||||
run: infer run --fail-on-issue --compilation-database compile_commands.json
|
||||
|
||||
- name: Upload Infer report
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: infer-report
|
||||
path: infer-out/report.txt
|
||||
if-no-files-found: ignore
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -114,3 +114,6 @@ RelWithDebInfo
|
||||
|
||||
#vim backups
|
||||
*.*~
|
||||
|
||||
# Infer static analysis output
|
||||
infer-out/
|
||||
|
||||
@@ -244,7 +244,7 @@ static void load_env_plugins(MYSQL *mysql)
|
||||
if (ma_check_env_str(s))
|
||||
return;
|
||||
|
||||
free_env= strdup(s);
|
||||
free_env= strdup(s); // @infer-ignore NULLPTR_DEREFERENCE
|
||||
plugs= s= free_env;
|
||||
|
||||
if (!free_env)
|
||||
|
||||
Reference in New Issue
Block a user