2022-02-18 03:40:40 +01:00
|
|
|
# Based on default config generated by GitHub, see also https://github.com/github/codeql-action
|
|
|
|
|
|
|
|
name: "CodeQL"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
schedule:
|
|
|
|
# Run every Monday at 16:10
|
|
|
|
- cron: '10 16 * * 1'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
analyze:
|
|
|
|
name: Analyze
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
language: [ 'java' ]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Initializes the CodeQL tools for scanning
|
|
|
|
- name: Initialize CodeQL
|
|
|
|
uses: github/codeql-action/init@v1
|
|
|
|
with:
|
|
|
|
languages: ${{ matrix.language }}
|
|
|
|
# Run all security queries and maintainability and reliability queries
|
|
|
|
queries: +security-and-quality
|
|
|
|
|
2022-04-18 15:52:53 +02:00
|
|
|
- name: Cache local Maven repository
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
|
|
|
|
2022-02-18 03:40:40 +01:00
|
|
|
# Only compile main sources, but ignore test sources because findings for them might not
|
|
|
|
# be that relevant (though GitHub security view also allows filtering by source type)
|
|
|
|
# Can replace this with github/codeql-action/autobuild action to run complete build
|
|
|
|
- name: Compile sources
|
|
|
|
run: |
|
2022-04-18 15:52:53 +02:00
|
|
|
mvn compile --batch-mode
|
2022-02-18 03:40:40 +01:00
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
|
|
|
uses: github/codeql-action/analyze@v1
|