-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (43 loc) · 1.29 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
name: Java Gradle Build and Test
on:
push:
branches:
- master
- staging
pull_request:
branches:
- master
- staging
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'corretto'
- name: Build and Test with Gradle
run: ./gradlew build
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results
path: sdk-java/build/reports/tests/
- name: Comment on PR with HTML Report Link
if: ${{ always() }}
uses: actions/github-script@v6
with:
script: |
const workspaceUrl = '${{ github.workspace }}/sdk-java/build/reports/tests/test/index.html'
const artifactLink = `<a href=${workspaceUrl}` target="_blank">HTML Test Report</a>`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Test report is available here: ${artifactLink}`,
});