forked from JakeWharton/diffuse
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (83 loc) · 2.8 KB
/
default.yaml
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
name: build
on:
pull_request:
push:
branches:
- master
- main
- trunk
- develop
- maine
- mane
schedule:
- cron: '0 3 * * 1,4'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
11
17
21
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew check --scan
- run: ./gradlew build --scan
- run: java -jar diffuse/build/libs/diffuse-unspecified-r8.jar
- uses: actions/cache@v4
if: github.event_name == 'pull_request'
name: Download base
with:
path: diffuse-source-file
key: diffuse-${{ github.event.pull_request.base.sha }}
- id: diffuse
if: github.event_name == 'pull_request'
uses: usefulness/[email protected]
with:
old-file-path: diffuse-source-file
new-file-path: diffuse/build/libs/diffuse-unspecified-r8.jar
- uses: peter-evans/find-comment@v3
if: github.event_name == 'pull_request'
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Diffuse output
- uses: peter-evans/create-or-update-comment@v4
if: ${{ steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null }}
with:
body: |
### Jar size:
Jar size change: ${{ steps.diffuse.outputs.size-diff-comment_style_1 }}
### Diffuse output:
${{ steps.diffuse.outputs.diff-gh-comment }}
edit-mode: replace
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
with:
name: diffuse-output
path: ${{ steps.diffuse.outputs.diff-file }}
- uses: actions/upload-artifact@v4
if: github.event_name != 'pull_request'
with:
name: diffuse-latest-binary.jar
path: diffuse/build/libs/diffuse-*-binary.jar
if-no-files-found: error
- uses: actions/cache@v4
name: Upload base
if: github.event_name != 'pull_request'
with:
path: diffuse-source-file
key: diffuse-${{ github.sha }}
- run: cp diffuse/build/libs/diffuse-unspecified-r8.jar diffuse-source-file
if: github.event_name != 'pull_request'
shell: bash