-
Notifications
You must be signed in to change notification settings - Fork 45
70 lines (63 loc) · 2.3 KB
/
Copy pathcodeql.yml
File metadata and controls
70 lines (63 loc) · 2.3 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
# CodeQL static analysis: the Java app AND the JNI/C glue. Mirrors the httrack
# repo's codeql.yml (security-extended). c-cpp is scoped to htslibjni*.c via
# .github/codeql/codeql-config.yml so the vendored engine isn't double-scanned.
#
# java-kotlin uses build-mode: none (the app doesn't build under modern Gradle
# until the AGP 8 migration in Phase 3 — no build needed to analyze the source).
# c-cpp builds the JNI glue via a self-contained NDK setup (no pre-published image).
name: CodeQL
on:
push:
branches: [master]
pull_request:
schedule:
- cron: "31 4 * * 1"
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
env:
NDK_VERSION: r26d
OPENSSL_VERSION: "3.0.15"
jobs:
analyze:
name: analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- { language: java-kotlin, build-mode: none }
- { language: c-cpp, build-mode: manual }
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
config-file: ./.github/codeql/codeql-config.yml
# c-cpp only: CodeQL must observe the native compile (arm64-v8a is enough).
- name: Set up NDK ${{ env.NDK_VERSION }}
if: matrix.language == 'c-cpp'
id: ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.NDK_VERSION }}
# No local-cache: its restore can drop the NDK clang binaries.
- name: Build native (c-cpp)
if: matrix.language == 'c-cpp'
env:
ANDROID_NDK_ROOT: ${{ steps.ndk.outputs.ndk-path }}
run: |
OUT=/tmp/openssl-android ABIS=arm64-v8a OPENSSL_VERSION="${OPENSSL_VERSION}" bash docker/build-openssl.sh
tools/ci/vendor-libiconv.sh
OPENSSL_ANDROID_ROOT=/tmp/openssl-android ABIS=arm64-v8a tools/ci/fetch-openssl-statics.sh
( cd app/src/main && "${ANDROID_NDK_ROOT}/ndk-build" APP_ABI=arm64-v8a APP_PLATFORM=android-24 -j"$(nproc)" )
- uses: github/codeql-action/analyze@v3