-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (67 loc) · 2.98 KB
/
maven-java.yml
File metadata and controls
78 lines (67 loc) · 2.98 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on: [ push, pull_request ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: mvn -B verify --file pom.xml
# generates coverage-report.md and publishes as checkrun
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@72266185b7ee48a6fd74eaf0238395cc8b14fef8 # v2.12.1
with:
jacoco-csv-file: java-odoo-rpc-core/target/site/jacoco/jacoco.csv
badges-directory: .github/badges
generate-coverage-badge: true
coverage-badge-filename: rpc-core-jacoco.svg
coverage-label: rpc-core
colors: '#4c1 #97ca00 #a4a61d #dfb317 #fe7d37 #e05d44'
intervals: 100 80 70 60 50 0
# generates coverage-report.md and publishes as checkrun
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@72266185b7ee48a6fd74eaf0238395cc8b14fef8 # v2.12.1
with:
jacoco-csv-file: java-odoo-json-rpc-client/target/site/jacoco/jacoco.csv
badges-directory: .github/badges
generate-coverage-badge: true
coverage-badge-filename: json-rpc-client-jacoco.svg
coverage-label: json-rpc
colors: '#4c1 #97ca00 #a4a61d #dfb317 #fe7d37 #e05d44'
intervals: 100 80 70 60 50 0
# generates coverage-report.md and publishes as checkrun
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@72266185b7ee48a6fd74eaf0238395cc8b14fef8 # v2.12.1
with:
jacoco-csv-file: java-odoo-xml-rpc-core/target/site/jacoco/jacoco.csv
badges-directory: .github/badges
generate-coverage-badge: true
coverage-badge-filename: xml-rpc-core-jacoco.svg
coverage-label: xml-rpc
colors: '#4c1 #97ca00 #a4a61d #dfb317 #fe7d37 #e05d44'
intervals: 100 80 70 60 50 0
- name: Commit and push the badge (if it changed)
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
default_author: github_actions
message: 'commit badges'
add: '*.svg'
author: "GitHub Actions"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}