2020-10-01 19:27:15 +07:00
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name : "CodeQL"
on :
push :
branches : [ master, release-7.1]
pull_request :
# The branches below must be a subset of the branches above
branches : [ master]
schedule :
- cron : '0 7 * * 4'
2020-10-01 20:21:47 +07:00
env :
java : 11
2020-10-01 19:27:15 +07:00
jobs :
analyze :
name : Analyze
runs-on : ubuntu-latest
strategy :
fail-fast : false
matrix :
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language : [ 'java' , 'javascript' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps :
2020-10-01 20:21:47 +07:00
# Install Java 14
- name : Setup Java
uses : actions/setup-java@v1
with :
java-version : '${{ env.java }}'
2020-10-01 19:27:15 +07:00
- name : Checkout repository
uses : actions/checkout@v2
with :
2020-11-30 09:37:49 +07:00
# fetch all commit so sornar can know who change a line, it's resolved Warning: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
fetch-depth : 0
if : github.event_name != 'pull_request'
2020-10-01 19:27:15 +07:00
2020-11-30 09:37:49 +07:00
- name : Checkout repository
uses : actions/checkout@v2
with :
ref : ${{ github.event.pull_request.head.sha }} # check out PR head
# fetch all commit so sornar can know who change a line, it's resolved Warning: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
fetch-depth : 0
if : github.event_name == 'pull_request'
- name : Cache material
uses : actions/cache@v2
with :
path : |
~/.sonar/cache
~/.m2
key : ${{ runner.os }}-master
2020-10-01 19:27:15 +07:00
# Initializes the CodeQL tools for scanning.
- name : Initialize CodeQL
uses : github/codeql-action/init@v1
with :
languages : ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
2020-11-30 09:37:49 +07:00
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1
2020-10-01 19:27:15 +07:00
# ℹ ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
2020-11-30 09:37:49 +07:00
- name : Build and analyze
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
run : |
export MAVEN_OPTS="-Xmx4G"
mvn -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dsonar.java.source=$java -Dsonar.java.target=$java verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
2020-10-01 19:27:15 +07:00
- name : Perform CodeQL Analysis
uses : github/codeql-action/analyze@v1