Update pr.yml

This commit is contained in:
Max
2021-05-19 01:53:40 +02:00
committed by GitHub
parent 648464f00a
commit 1d1cbff0cd

View File

@@ -8,31 +8,114 @@ on:
- '**/src/**'
types: [ opened, synchronize, reopened ]
jobs:
validate-gradle:
name: "Validate Gradle wrapper"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
license:
name: "Verify License integrity"
runs-on: ubuntu-20.04
if: |
!contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
- name: Cache Gradle wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/**/*') }}
restore-keys: gradle-wrapper-${{ runner.os }}-
- name: Cache packages
id: cache-packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-packages-${{ runner.os }}-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: |
./gradlew licenseCheck
# Remove some potentially problematic files from the Gradle cache,
# so that GitHub Actions doesn't cache them.
- name: Cleanup Gradle Cache
if: steps.cache-packages.outputs.cache-hit != 'true'
run: |
rm -f $HOME/.gradle/caches/*/*.lock
rm -rf $HOME/.gradle/caches/*/plugin-resolution/
rm -rf $HOME/.gradle/caches/*/scripts/
rm -rf $HOME/.gradle/caches/*/scripts-remapped/
rm -rf $HOME/.gradle/caches/*/fileHashes/
rm -f $HOME/.gradle/caches/journal-1/file-access.bin
build:
name: "Build"
strategy:
matrix:
java: [ 8-jdk, 11-jdk, 15-jdk ]
java: [ 8, 11, 15 ]
runs-on: ubuntu-20.04
container:
image: openjdk:${{ matrix.java }}
options: --user root
if: |
!contains(github.event.pull_request.title, '[ci skip]')
!contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Cache Gradle wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/**/*') }}
restore-keys: gradle-wrapper-${{ runner.os }}-
- name: Cache packages
id: cache-packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-packages-${{ runner.os }}-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: |
./gradlew build --stacktrace --no-daemon
# Remove some potentially problematic files from the Gradle cache,
# so that GitHub Actions doesn't cache them.
- name: Cleanup Gradle Cache
if: steps.cache-packages.outputs.cache-hit != 'true'
run: |
rm -f $HOME/.gradle/caches/*/*.lock
rm -rf $HOME/.gradle/caches/*/plugin-resolution/
rm -rf $HOME/.gradle/caches/*/scripts/
rm -rf $HOME/.gradle/caches/*/scripts-remapped/
rm -rf $HOME/.gradle/caches/*/fileHashes/
rm -f $HOME/.gradle/caches/journal-1/file-access.bin
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
@@ -40,7 +123,7 @@ jobs:
path: |
**/build/libs/
!build/libs/
!**/*-dev.jar
!**/*-shadow.jar
!**/*-transformProduction([\w]+).jar
- name: Verify License integrity
run: ./gradlew licenseCheck
!**/*-transformProduction*.jar
!**/testmod*/