Repository navigation
105 lines (95 loc) · 3.93 KB
/
Copy pathcodeql.yml
File metadata and controls
105 lines (95 loc) · 3.93 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
# SPDX-FileCopyrightText: 2026 ReallyMe Technologies Limited
#
# SPDX-License-Identifier: MIT OR Apache-2.0
name: CodeQL
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "**/*.md"
- "docs/**"
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "docs/**"
schedule:
- cron: '19 4 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
permissions:
contents: read
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: actions
os: ubuntu-24.04
build-mode: none
- language: javascript-typescript
os: ubuntu-24.04
build-mode: none
- language: rust
os: ubuntu-24.04
build-mode: none
- language: java-kotlin
os: ubuntu-24.04
build-mode: manual
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Validate Gradle wrapper
if: matrix.language == 'java-kotlin'
uses: gradle/actions/wrapper-validation@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Install Java
if: matrix.language == 'java-kotlin'
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
distribution: temurin
java-version: '21'
cache: gradle
cache-dependency-path: |
packages/kotlin/gradle.lockfile
packages/kotlin-android/gradle.lockfile
crates/conformance/platform/kotlin/gradle.lockfile
packages/kotlin/buildscript-gradle.lockfile
packages/kotlin-android/buildscript-gradle.lockfile
crates/conformance/platform/kotlin/buildscript-gradle.lockfile
packages/kotlin/gradle/verification-metadata.xml
packages/kotlin-android/gradle/verification-metadata.xml
crates/conformance/platform/kotlin/gradle/verification-metadata.xml
- name: Initialize CodeQL
uses: github/codeql-action/init@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
- name: Build Java and Kotlin for analysis
if: matrix.language == 'java-kotlin'
# The independent Gradle roots are not discovered by the automatic
# builder. Trace the JVM, Android, and conformance source sets explicitly.
# Android extraction needs compiled JVM sources, not rebuilt JNI artifacts;
# the Kotlin/native ABI gates validate those artifacts separately.
run: |
# Tracing the generated protobuf DSLs exceeds the default compiler heap.
gradle_args=(--dependency-verification strict --no-daemon --no-build-cache --rerun-tasks -Pkotlin.daemon.jvmargs=-Xmx2g)
packages/kotlin/gradlew -p packages/kotlin "${gradle_args[@]}" compileKotlin compileJava
packages/kotlin-android/gradlew -p packages/kotlin-android "${gradle_args[@]}" compileReleaseKotlin compileReleaseJavaWithJavac -x buildAndroidJniLibs -x generateAndroidNativeManifest -x verifyAndroidJniLibs
crates/conformance/platform/kotlin/gradlew -p crates/conformance/platform/kotlin "${gradle_args[@]}" compileKotlin
- name: Analyze CodeQL
uses: github/codeql-action/analyze@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
with:
category: /language:${{ matrix.language }}