Skip to content

Commit 2816db8

Browse files
Add CodeQL analysis
1 parent 2f03ec8 commit 2816db8

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

.github/workflows/unit-test.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,62 @@ jobs:
5252
if: runner.os == 'Linux'
5353
with:
5454
name: coverage_report
55-
path: .qodana/code-coverage/report.xml
55+
path: build/code-coverage/report.xml
5656
retention-days: 1
5757
if-no-files-found: error
5858

59+
- name: Perform CodeQL analysis
60+
uses: github/codeql-action/analyze@v3
61+
if: runner.os == 'Linux'
62+
with:
63+
upload: false
64+
output: build/sarif-results
65+
66+
- name: Upload CodeQL report
67+
uses: actions/upload-artifact@v4
68+
if: runner.os == 'Linux'
69+
with:
70+
name: codeql_analysis
71+
path: build/sarif-results/java.sarif
72+
retention-days: 1
73+
if-no-files-found: error
74+
75+
codeql:
76+
name: Upload CodeQL analysis
77+
needs: tests
78+
runs-on: ubuntu-latest
79+
permissions:
80+
checks: write
81+
security-events: write
82+
steps:
83+
- name: Checkout code changes
84+
uses: actions/checkout@v5
85+
with:
86+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
87+
fetch-depth: 0
88+
89+
- name: Download coverage report
90+
uses: actions/download-artifact@v5
91+
with:
92+
name: codeql_analysis
93+
path: build/sarif-results
94+
95+
- name: Filter SARIF
96+
uses: advanced-security/filter-sarif@v1
97+
if: runner.os == 'Linux'
98+
with:
99+
patterns: |
100+
-.gradle/**
101+
-**/generated/**
102+
input: build/sarif-results/java.sarif
103+
output: build/sarif-results/java.sarif
104+
105+
- name: Upload SARIF
106+
uses: github/codeql-action/upload-sarif@v3
107+
with:
108+
sarif_file: build/sarif-results/java.sarif
109+
category: "/language:java-kotlin"
110+
59111
qodana:
60112
name: Perform Qodana analysis
61113
if: ${{ vars.QODANA_ENABLED == 'true' }}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jacocoTestReport {
7070
reports {
7171
html.required = false
7272
xml.required = true
73-
xml.outputLocation = file('.qodana/code-coverage/report.xml')
73+
xml.outputLocation = file('build/code-coverage/report.xml')
7474
}
7575

7676
afterEvaluate {

0 commit comments

Comments
 (0)