-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (174 loc) · 6.3 KB
/
Copy pathcodeql.yml
File metadata and controls
197 lines (174 loc) · 6.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CodeQL
on:
push:
branches: [dev]
pull_request:
branches: [dev, main]
schedule:
- cron: '17 4 * * 1'
workflow_dispatch:
permissions:
security-events: write
packages: read
actions: read
contents: read
concurrency:
group: codeql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
kmp: ${{ steps.filter.outputs.kmp }}
website: ${{ steps.filter.outputs.website }}
workflows: ${{ steps.filter.outputs.workflows }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Filter paths
id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
with:
filters: |
workflows:
- '.github/workflows/**'
- '.github/actions/**'
website:
- 'website/**'
kmp:
- 'androidApp/**'
- 'composeApp/**'
- 'shared/**'
- 'server/**'
- 'gradle/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'
- 'gradlew.bat'
analyze-jvm-kotlin:
name: Analyze JVM Kotlin (manual build)
needs: changes
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.changes.outputs.kmp == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up JDK 25
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: temurin
java-version: '25'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
with:
dependency-graph: disabled
- name: Set up Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4
- name: Prepare Android SDK manager
shell: bash
run: |
set -euo pipefail
(yes || true) | sdkmanager --licenses >/dev/null || true
sdkmanager "platform-tools"
- name: Prepare google-services config for CI
shell: bash
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
set -euo pipefail
if [ -f "androidApp/google-services.json" ]; then
echo "Found androidApp/google-services.json in workspace."
exit 0
fi
if [ -n "${GOOGLE_SERVICES_JSON:-}" ]; then
echo "${GOOGLE_SERVICES_JSON}" > androidApp/google-services.json
echo "Wrote androidApp/google-services.json from repository secret."
exit 0
fi
cat > androidApp/google-services.json <<'JSON'
{
"project_info": {
"project_number": "1234567890",
"project_id": "ci-placeholder",
"storage_bucket": "ci-placeholder.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1234567890:android:abcdef1234567890",
"android_client_info": {
"package_name": "com.tajemniktv.tajsos"
}
},
"api_key": [
{
"current_key": "AIzaSyCIPlaceholderKey"
}
]
}
],
"configuration_version": "1"
}
JSON
- name: Initialize CodeQL (java-kotlin)
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
languages: java-kotlin
build-mode: manual
queries: security-extended
- name: Build Kotlin/JVM + Android targets for CodeQL
shell: bash
run: |
./gradlew \
-Pandroid.builder.sdkDownload=true \
--no-build-cache \
clean \
:shared:compileKotlinJvm \
:composeApp:compileKotlinJvm \
:server:classes \
:androidApp:assembleDebug \
--stacktrace \
- name: Perform CodeQL Analysis (java-kotlin)
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
category: /language:java-kotlin
analyze-actions:
name: Analyze GitHub Actions workflows
needs: changes
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.changes.outputs.workflows == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Initialize CodeQL (actions)
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
languages: actions
build-mode: none
queries: security-extended
- name: Perform CodeQL Analysis (actions)
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
category: /language:actions
analyze-js-ts:
name: Analyze website JavaScript/TypeScript
needs: changes
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.changes.outputs.website == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Initialize CodeQL (javascript-typescript)
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
languages: javascript-typescript
build-mode: none
queries: security-extended
- name: Perform CodeQL Analysis (javascript-typescript)
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
category: /language:javascript-typescript
# Swift is intentionally omitted for now. This repository's iosApp target is a thin wrapper
# and does not have a reliable macOS CI build path yet for CodeQL manual extraction.