-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (52 loc) · 1.71 KB
/
ci.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
name: CI with Maven
on:
push:
branches: [ main ]
pull_request:
branches: '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
if: matrix.os == 'ubuntu-latest'
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven (Windows)
run: mvn -U -ntp clean verify
shell: cmd
if: matrix.os == 'windows-latest'
- name: Build with Maven (not Windows)
run: mvn -U -ntp clean verify
if: matrix.os != 'windows-latest'
- name: Convert Jacoco to Cobertura
run: |
python3 ./.github/scripts/cover2cover.py target/jacoco-report/jacoco.xml src/main/java > target/jacoco-report/cobertura.xml
if: matrix.os == 'ubuntu-latest'
- name: Upload Coverage
uses: actions/[email protected]
if: matrix.os == 'ubuntu-latest'
with:
name: Coverage Report
path: target/jacoco-report
- name: Save PR number
run: |
mkdir -p ./pr/jacoco-report
echo ${{ github.event.number }} > ./pr/NR
echo ${{ github.event.pull_request.head.sha }} > ./pr/SHA
cp target/jacoco-report/cobertura.xml ./pr/jacoco-report/cobertura.xml
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
- name: Upload files
uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'