forked from gotson/webp-imageio
-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (75 loc) · 2.58 KB
/
run_diffuse.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
name: Diffuse
on:
pull_request:
branches:
- master
- main
- trunk
- develop
- maine
- mane
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
permissions:
contents: read
pull-requests: write
jobs:
run-diffuse:
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
shell: bash
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- uses: gradle/gradle-build-action@v2
- run: ./gradlew assemble
- run: find . -regex ".*webp-imageio/build/libs/webp-imageio-[0-9SNAPSHOT\.-]*\.jar" -print | xargs -n 1 -I % cp % pull-request-artifact.jar
shell: bash
- name: Check size
run: du -h pull-request-artifact.jar
shell: bash
- uses: actions/cache@v3
name: Download base
with:
path: |
diffuse-source-file
key: diffuse-${{ github.event.pull_request.base.sha }}
restore-keys: diffuse-${{ github.event.pull_request.base.sha }}
- id: diffuse
uses: usefulness/diffuse-action@v1
with:
old-file-path: diffuse-source-file
new-file-path: pull-request-artifact.jar
- uses: peter-evans/find-comment@v2
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Diffuse output
- uses: peter-evans/create-or-update-comment@v3
if: ${{ steps.diffuse.outputs.diff-gh-comment != 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@v3
with:
name: diffuse-output
path: ${{ steps.diffuse.outputs.diff-file }}