-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (94 loc) · 3.08 KB
/
gradle.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
- uses: actions/checkout@v1
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build
run: ./gradlew build -x test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
path: "**/build/libs"
test:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
- uses: actions/checkout@v1
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Test
run: ./gradlew test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Coverage
run: ./gradlew jacocoTestReport
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload CodeCov Report
uses: codecov/codecov-action@v1
with:
file: "**/build/reports/jacoco/**/*.xml"
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
with:
files: "**/build/test-results/**/*.xml"
release:
needs: [build, test]
if: github.ref == 'refs/heads/master' || 'refs/heads/beta' || github.ref == 'refs/heads/alpha'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Set up Node.js v18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
- uses: actions/checkout@v1
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Grant execute permission for update-versions.sh
run: chmod +x update-versions.sh
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_URL: "https://api.github.com/"
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
run: npx --legacy-peer-deps -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p gradle-semantic-release-plugin -p semantic-release semantic-release