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
69 changes: 69 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow configures CodeQL as the auto-configuration fails for Java/Kotlin.
#
# @author Armin Schnabel
# @version 1.0.0
# @since 4.2.0
name: "CodeQL Analysis"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '23 11 * * 2'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}

permissions:
# required for all workflows
security-events: write

strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: manual # autobuild fails (gradle.properties required)

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
# 'java-kotlin' to analyze code written in Java, Kotlin or both
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
# Only update cache on hash change (gradle build files and the wrapper properties)
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-

#- name: Grant execute permission for Gradle wrapper
# run: chmod +x gradlew

- name: Add gradle.properties
run: cp gradle.properties.template gradle.properties

- name: Build with Gradle
run: ./gradlew build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
8 changes: 8 additions & 0 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@ jobs:
run: |
cp gradle.properties.template gradle.properties

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
# Only update cache on hash change (gradle build files and the wrapper properties)
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-

- name: Build with Gradle
run: ./gradlew build
Loading