-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (51 loc) · 2.13 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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: [ main, develop, issue-75-british-library, 140-pica-parsing-pica-record ]
pull_request:
branches: [ main, develop, issue-75-british-library, 140-pica-parsing-pica-record ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze with Sonar
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 -DskipGpg=true
# coverage report: https://app.codecov.io/gh/pkiraly/metadata-qa-marc
- name: Pubish code coverage at codecov.io
uses: codecov/codecov-action@v4
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov
# COVERALL_REPO_TOKEN is available as the TOKEN variable at https://coveralls.io/github/pkiraly/metadata-qa-marc
# coverage report: https://coveralls.io/github/pkiraly/metadata-qa-marc
- name: Coveralls Coverage Report Submission
run: mvn coveralls:report -DrepoToken=${{ secrets.COVERALL_REPO_TOKEN }}