-
Notifications
You must be signed in to change notification settings - Fork 28
37 lines (30 loc) · 1.05 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
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Enhance GitHub Environment Variables
run: echo "GITHUB_REF_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install CodeClimate Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > cc-test-reporter
chmod +x cc-test-reporter
./cc-test-reporter before-build
- name: Build with Maven
run: mvn verify -B -V
- if: github.ref == 'refs/heads/main'
name: Upload CodeClimate Report
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_COMMIT_SHA: ${{ env.GITHUB_SHA }}
GIT_BRANCH: ${{ env.GITHUB_REF_NAME }}
JACOCO_SOURCE_PATH: src/main/java
run: |
./cc-test-reporter format-coverage -t jacoco ./target/site/jacoco/jacoco.xml
./cc-test-reporter upload-coverage