Repository navigation
85 lines (76 loc) · 3.01 KB
/
Copy pathcodeql.yml
File metadata and controls
85 lines (76 loc) · 3.01 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
# CodeQL static analysis: the Java app AND the JNI glue. Mirrors the httrack
# repo's codeql.yml (security-extended). The build steps below are what scope
# c-cpp, because GitHub honours a config-file path filter only for a language it
# does not build.
#
# 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: r27d
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@v7
with:
submodules: recursive
- 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.
# This build stays untraced on purpose, so nothing it compiles reaches the
# extractor and the vendored engine stays out of our results. One ABI is
# enough, because the other compiles the same sources.
- name: Build the engine, untraced (c-cpp)
if: matrix.language == 'c-cpp'
env:
ANDROID_NDK_ROOT: ${{ steps.ndk.outputs.ndk-path }}
run: |
OUT=/tmp/openssl-android ABIS=arm64-v8a 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/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
config-file: ./.github/codeql/codeql-config.yml
# The touched files are exactly the htslibjni module's LOCAL_SRC_FILES, so make
# recompiles those and relinks. Extraction happens at compile, not at link.
- name: Recompile the JNI glue, traced (c-cpp)
if: matrix.language == 'c-cpp'
env:
ANDROID_NDK_ROOT: ${{ steps.ndk.outputs.ndk-path }}
run: |
touch app/src/main/jni/htslibjni.c \
app/src/main/jni/coffeecatch/coffeecatch.c \
app/src/main/jni/coffeecatch/coffeejni.c
( cd app/src/main && "${ANDROID_NDK_ROOT}/ndk-build" APP_ABI=arm64-v8a APP_PLATFORM=android-24 )
- uses: github/codeql-action/analyze@v4