Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
40066545
Unverified
Commit
40066545
authored
Mar 24, 2021
by
Gautier de Saint Martin Lacaze
Committed by
GitHub
Mar 24, 2021
Browse files
build: add sonar analysis through github action
parent
b5e8e839
Changes
1
Hide whitespace changes
Inline
Side-by-side
.github/workflows/build.yml
0 → 100644
View file @
40066545
name
:
Build
on
:
push
:
branches
:
-
master
pull_request
:
types
:
[
opened
,
synchronize
,
reopened
]
jobs
:
build
:
name
:
Build
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
with
:
fetch-depth
:
0
# Shallow clones should be disabled for a better relevancy of analysis
-
name
:
Set up JDK
8
uses
:
actions/setup-java@v1
with
:
java-version
:
8
-
name
:
Cache SonarCloud packages
uses
:
actions/cache@v1
with
:
path
:
~/.sonar/cache
key
:
${{ runner.os }}-sonar
restore-keys
:
${{ runner.os }}-sonar
-
name
:
Cache Maven packages
uses
:
actions/cache@v1
with
:
path
:
~/.m2
key
:
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys
:
${{ runner.os }}-m2
-
name
:
Build and analyze
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
# Needed to get PR information, if any
SONAR_TOKEN
:
${{ secrets.SONAR_TOKEN }}
run
:
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment