Skip to content

Commit 8bb01f8

Browse files
authored
Split GitHub actions to avoid updating badges on PR (#5)
1 parent e444fa0 commit 8bb01f8

2 files changed

Lines changed: 60 additions & 4 deletions

File tree

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
# separate terms of service, privacy policy, and support
77
# documentation.
88

9-
name: Java CI with Maven
9+
name: Post merge Java CI with Maven
1010

1111
on:
1212
push:
1313
branches:
1414
- main
15-
pull_request:
16-
branches:
17-
- main
1815

1916
jobs:
2017
build:

.github/workflows/pr.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: PR update Java CI with Maven
10+
11+
on:
12+
pull_request:
13+
branches:
14+
- main
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: '11'
27+
distribution: 'temurin'
28+
cache: maven
29+
30+
- name: Check coding style
31+
run: mvn -B -ntp checkstyle:check
32+
33+
- name: Dependency tree
34+
run: mvn -B -ntp dependency:tree
35+
36+
- name: Dependency checking
37+
run: mvn -B -ntp dependency:analyze-only
38+
39+
- name: Unit test and coverage
40+
run: mvn -B -ntp test jacoco:report
41+
42+
- name: Build with Maven
43+
run: mvn -B -ntp -DskipTests=true -Dcheckstyle.skip package
44+
45+
- name: Code Coverage Report
46+
id: jacoco
47+
uses: madrapps/jacoco-report@v1.3
48+
with:
49+
paths: ${{ github.workspace }}/target/site/jacoco/jacoco.xml
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
min-coverage-overall: 80
52+
min-coverage-changed-files: 90
53+
54+
- name: Upload Coverage Report
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: jacoco-report
58+
path: target/site/jacoco/
59+

0 commit comments

Comments
 (0)