Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
permissions:
contents: write
security-events: write
strategy:
fail-fast: false
matrix:
Expand All @@ -23,6 +24,13 @@ jobs:
- name: Checkout code changes
uses: actions/checkout@v5

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
if: runner.os == 'Linux'
with:
languages: "java"
queries: security-and-quality

- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
Expand Down Expand Up @@ -52,10 +60,61 @@ jobs:
if: runner.os == 'Linux'
with:
name: coverage_report
path: .qodana/code-coverage/report.xml
path: build/code-coverage/report.xml
retention-days: 1
if-no-files-found: error

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
if: runner.os == 'Linux'
with:
upload: false
output: build/sarif-results

- name: Upload CodeQL report
uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: codeql_analysis
path: build/sarif-results/java.sarif
retention-days: 1
if-no-files-found: error

codeql:
name: Upload CodeQL analysis
needs: tests
runs-on: ubuntu-latest
permissions:
checks: write
security-events: write
steps:
- name: Checkout code changes
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0

- name: Download CodeQL analysis
uses: actions/download-artifact@v5
with:
name: codeql_analysis
path: build/sarif-results

- name: Filter SARIF
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-.gradle/**
-**/generated/**
input: build/sarif-results/java.sarif
output: build/sarif-results/java.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: build/sarif-results/java.sarif
category: "/language:java"

qodana:
name: Perform Qodana analysis
if: ${{ vars.QODANA_ENABLED == 'true' }}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jacocoTestReport {
reports {
html.required = false
xml.required = true
xml.outputLocation = file('.qodana/code-coverage/report.xml')
xml.outputLocation = file('build/code-coverage/report.xml')
}

afterEvaluate {
Expand All @@ -88,7 +88,7 @@ def generateCohArchive = tasks.register('generateCohArchive', Exec) {
inputs.dir(jlink.map { it.outputDirectory.get().asFile })

def java = jlink.map { it.outputDirectory.file('jre/bin/java').get().asFile.absolutePath }
doFirst { commandLine(java.get(), '-XX:+UseCompactObjectHeaders', '-Xshare:dump') }
doFirst { commandLine(java.get(), '-XX:+UseCompactObjectHeaders', '-Xshare:dump', '-XX:+UnlockDiagnosticVMOptions', '-XX:+AllowArchivingWithJavaAgent') }
}

jlink.configure { finalizedBy(generateCohArchive) }
Expand Down
Loading