-
-
Notifications
You must be signed in to change notification settings - Fork 182
70 lines (61 loc) · 2.03 KB
/
Copy pathcodeql.yml
File metadata and controls
70 lines (61 loc) · 2.03 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
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Re-scan weekly so newly published CodeQL queries catch issues in code
# that hasn't changed since the last push.
- cron: '27 4 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze (Java)
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
# required for actions/checkout of private repos and to upload results
security-events: write
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v7
# JDK 17 matches the build job; required to compile logback-android.
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java
# Manual build: the Android Gradle plugin needs a real Gradle
# invocation, so autobuild can't reliably trace compilation.
build-mode: manual
queries: security-and-quality
# Compile the library so CodeQL can observe the bytecode. The Android SDK
# is preinstalled on the ubuntu-latest runner (same as the build job).
#
# --no-daemon keeps javac in a process tree CodeQL's tracer can follow,
# and --no-build-cache forces the compile tasks to actually run instead
# of resolving FROM-CACHE (the project enables org.gradle.caching). Both
# are needed or CodeQL extracts nothing and fails with "no source code
# seen during build".
- name: Assemble
run: ./gradlew assembleRelease --no-daemon --no-build-cache
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: '/language:java'