Skip to content

Commit 641df74

Browse files
authored
Add CodeQL workflow for Kotlin analysis (#200)
1 parent 238bdb1 commit 641df74

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '0 4 * * 0'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# required for all workflows
17+
security-events: write
18+
19+
# required to fetch internal or private CodeQL packs
20+
packages: read
21+
22+
# only required for workflows in private repositories
23+
actions: read
24+
contents: read
25+
26+
strategy:
27+
matrix:
28+
language: [ java-kotlin ]
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: '21'
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v3
42+
with:
43+
languages: ${{ matrix.language }}
44+
build-mode: manual
45+
46+
- uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.gradle/caches
50+
~/.gradle/wrapper
51+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
52+
53+
- name: Build Kotlin sources
54+
run: |
55+
./gradlew \
56+
:build -Pkotlin.incremental=false \
57+
--no-daemon --stacktrace --parallel
58+
59+
- name: Analyze
60+
uses: github/codeql-action/analyze@v3
61+
with:
62+
category: '/language:${{ matrix.language }}'

0 commit comments

Comments
 (0)