Skip to content

build

build #542

Workflow file for this run

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