-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (50 loc) · 1.48 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
51
52
53
54
name: build
on:
push:
branches: '*'
tags: '*'
pull_request:
jobs:
unitTest:
runs-on: ubuntu-20.04
steps:
- name: Checkout the project
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build the project
run: ./gradlew build --stacktrace
- name: Run unit tests
run: ./gradlew check --stacktrace
- name: Upload coverage results
run: ./gradlew coverage coveralls --stacktrace
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set release name
run: sed -i "s/^\s+version '.*'/version '${{ github.event.inputs.version }}'/" build.gradle && cat build.gradle
if: ${{ github.event.inputs.version }}
- name: Build the project
run: ./gradlew build --stacktrace
- name: Publish package to Github
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}