-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 1.68 KB
/
build_pr.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 PR
concurrency: ci-${{ github.ref }}
on: [pull_request]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup Java
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- uses: gradle/gradle-build-action@v2
name: Setup Gradle
with:
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') }}
- name: Build
id: assemble
run: |
./gradlew assemble
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Test
run: |
./gradlew check --continue
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: (success() || failure()) && steps.assemble.conclusion == 'success'
with:
name: junit-test-results
path: "*/build/test-results/*/TEST-*.xml"
retention-days: 1
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
if: (success() || failure()) && steps.assemble.conclusion == 'success'
with:
name: jacoco-coverage
path: "build/reports/jacoco/testCodeCoverageReport"
- name: Publish
if: steps.assemble.conclusion == 'success'
run: |
./gradlew publish
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Archive publishable artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: build/repo
retention-days: 1