forked from FirebirdSQL/php-firebird
-
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·116 lines (99 loc) · 3.46 KB
/
Copy pathcodeql.yml
File metadata and controls
executable file
·116 lines (99 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CodeQL Security Analysis
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# Run weekly on Sunday at midnight UTC
- cron: '0 0 * * 0'
# Cancel in-progress runs for the same branch
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ==========================================================================
# CodeQL Analysis for C/C++ (Primary focus - PHP extension code)
# ==========================================================================
analyze-cpp:
name: CodeQL C/C++
runs-on: ubuntu-24.04
timeout-minutes: 60
container:
image: php:8.3-cli-bookworm
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install build dependencies
run: |
set -eu
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
autoconf \
build-essential \
ca-certificates \
g++ \
git \
libicu-dev \
libreadline-dev \
libssl-dev \
libtool \
pkg-config \
wget \
curl \
unzip \
zlib1g-dev
rm -rf /var/lib/apt/lists/*
- name: Install Firebird client libraries
run: |
set -eu
# Download and install Firebird 5.0 for client libraries
# Pinned to specific commit SHA for supply-chain safety (issue #223).
# Update by changing the SHA after reviewing the script at:
# https://github.com/IBSurgeon/firebirdlinuxinstall/commit/<NEW_SHA>
FB_SCRIPT_URL="https://raw.githubusercontent.com/IBSurgeon/firebirdlinuxinstall/4a0b76a957c9ba75da1307c8ee5f9ccfc6f823c9/fb_vanilla-50.sh"
curl -fsSL "${FB_SCRIPT_URL}" -o /tmp/fb_install.sh
chmod +x /tmp/fb_install.sh
printf '\n' | /tmp/fb_install.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
languages: cpp
# Use security-extended for comprehensive security analysis
queries: security-extended
# Configure CodeQL to focus on our extension code
config: |
paths:
- '*.c'
- '*.cpp'
- '*.h'
paths-ignore:
- 'tests/**'
- 'docs/**'
- 'build/**'
- name: Build extension for CodeQL analysis
env:
FB_CONFIG: "no"
run: |
set -eu
export PATH="/opt/firebird/bin:${PATH}"
export LD_LIBRARY_PATH="/opt/firebird/lib:${LD_LIBRARY_PATH:-}"
export CFLAGS="-I/opt/firebird/include ${CFLAGS:-}"
export LDFLAGS="-L/opt/firebird/lib ${LDFLAGS:-}"
phpize
./configure --with-firebird=/opt/firebird
make -j"$(nproc)"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
category: "/language:cpp"
# NOTE: CodeQL does not support PHP as an analysis language.
# PHP wrapper classes in src/Firebird/ are covered by PHPStan
# (see code-quality.yml) instead.