-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (49 loc) · 1.81 KB
/
build.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
name: Build cwms-data-api-client
on:
push:
pull_request:
branches:
- main
jobs:
build:
name: build and test
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup java
uses: actions/setup-java@v4
with:
java-version: '21'
java-package: jdk
distribution: 'temurin'
- name: build and test
id: thebuild
run: ./gradlew build --info --init-script init.gradle
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
dotnet-quality: 'ga'
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: cwms-aaa-client/build/reports/jacoco/test/jacocoTestReport.xml;cwms-http-client/build/reports/jacoco/test/jacocoTestReport.xml;cwms-radar-client/build/reports/jacoco/test/jacocoTestReport.xml
targetdir: .github/coveragereport
reporttypes: Html;MarkdownSummaryGithub;Badges
- name: Upload coverage report artifact
uses: actions/[email protected]
with:
name: CoverageReport # Artifact name
path: .github/coveragereport # Directory containing files to upload
- name: Commit and push Badges
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/main'
run: |
cd .github/coveragereport
if [[ `git status --porcelain badge_*coverage.svg` ]]; then
git config --global user.name 'builduser'
git config --global user.email '[email protected]'
git add badge_*coverage.svg
git commit -m "Autogenerated JaCoCo coverage badge" badge_*coverage.svg
git push
fi