-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (43 loc) · 1.55 KB
/
Copy pathbuild.yml
File metadata and controls
52 lines (43 loc) · 1.55 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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Add GITHUB Environment Variables
run: |
echo "GITHUB_REF_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
if [[ "${GITHUB_REF}" = refs/heads/* ]]
then
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" = refs/tags/* ]]
then
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
- 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
- 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