-
Notifications
You must be signed in to change notification settings - Fork 20
47 lines (43 loc) · 1.52 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
env:
coveralls_token: ${{ secrets.COVERALLS_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Cache
uses: actions/[email protected]
with:
path: |
~/.m2/repository
~/.sonar/cache
key: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw -B verify -Prun-coverage
- name: Report coverage
run: ./mvnw -B coveralls:report -DrepoToken="${{ env.coveralls_token }}"
if: ${{ github.repository_owner == 'jcgay' && github.actor != 'dependabot[bot]' }}
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'temurin'
- name: Analyze with sonarcloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B sonar:sonar -Dsonar.projectKey=fr.jcgay.maven:maven-profiler -Dsonar.organization=jcgay-github -Dsonar.host.url=https://sonarcloud.io
if: ${{ github.repository_owner == 'jcgay' && github.actor != 'dependabot[bot]' }}