1
+ # CI with maven build and scan
2
+ #
3
+ # version 1.0.1
4
+ #
5
+ # see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html
6
+
7
+ name : CI maven build and scan
8
+
9
+ on :
10
+ # Trigger analysis when pushing in master or pull requests, and when creating
11
+ # a pull request.
12
+ push :
13
+ branches :
14
+ - main
15
+ - develop
16
+ - branch-preview
17
+ pull_request :
18
+ types :
19
+ - opened
20
+ - synchronize
21
+ - reopened
22
+
23
+ jobs :
24
+ build :
25
+ name : Build
26
+ runs-on : ubuntu-latest
27
+ steps :
28
+
29
+ - uses : actions/checkout@main
30
+ with :
31
+ # Shallow clones should be disabled for a better relevancy of analysis
32
+ fetch-depth : 0
33
+
34
+ - uses : graalvm/setup-graalvm@main
35
+ with :
36
+ java-version : ' 22-ea'
37
+ distribution : ' graalvm'
38
+ github-token : ${{ secrets.GITHUB_TOKEN }}
39
+ native-image-job-reports : ' true'
40
+
41
+ - name : Cache Maven packages
42
+ uses : actions/cache@main
43
+ with :
44
+ path : ~/.m2
45
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
46
+ restore-keys : ${{ runner.os }}-m2
47
+ - name : Cache SonarCloud packages
48
+ uses : actions/cache@main
49
+ with :
50
+ path : ~/.sonar/cache
51
+ key : ${{ runner.os }}-sonar
52
+ restore-keys : ${{ runner.os }}-sonar
53
+ - uses : actions/setup-node@main
54
+ with :
55
+ node-version : 20
56
+ - name : Maven version
57
+ run : mvn -v
58
+ env :
59
+ # Needed to get some information about the pull request, if any
60
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
+ # SonarCloud access token should be generated from https://sonarcloud.io/account/security/
62
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
63
+ - name : Build and analyze
64
+ run : mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit,buildreact -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}}
65
+ env :
66
+ # Needed to get some information about the pull request, if any
67
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
68
+ # SonarCloud access token should be generated from https://sonarcloud.io/account/security/
69
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
70
+
71
+ # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
72
+ - name : Update dependency graph
73
+ # if DISABLE_MAVEN_DEPENDENCY_SUBMISSION is set to true, skip this step
74
+ if : ${{ vars.DISABLE_MAVEN_DEPENDENCY_SUBMISSION != 'true' }}
75
+ uses : advanced-security/maven-dependency-submission-action@main
0 commit comments