From 202631ca266480316a7d5706308368799c7ebfb5 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 23 Nov 2020 18:49:08 +0100 Subject: [PATCH] Update github actions workflow --- .github/workflows/build.yml | 50 +++++++++++++++++ .github/workflows/gradle.yml | 56 ------------------- .github/workflows/validate-gradle-wrapper.yml | 12 ++++ 3 files changed, 62 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/validate-gradle-wrapper.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..eb9597bb4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: "build" + +on: ["pull_request", "push"] + +jobs: + build: + strategy: + matrix: + java: ["1.8", "11"] + os: ["ubuntu-18.04"] + runs-on: "${{ matrix.os }}" + steps: + - name: "Checkout Repository" + uses: "actions/checkout@v2.3.4" + - name: "Setup JDK ${{ matrix.java }}" + uses: "actions/setup-java@v1.4.3" + with: + java-version: "${{ matrix.java }}" + - name: "Cache Gradle" + uses: "actions/cache@v2.1.3" + with: + path: | + "~/.gradle/caches" + "~/.gradle/wrapper" + key: "${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}" + restore-keys: | + "${{ runner.os }}-${{ matrix.java }}-gradle-" + - name: "Cache Local Maven Repository" + uses: "actions/cache@v2.1.3" + with: + path: "~/.m2/repository" + key: "${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}" + restore-keys: | + "${{ runner.os }}-${{ matrix.java }}-maven-" + - name: "Cache BuildTools Decompiled Code" + uses: "actions/cache@v2.1.3" + with: + path: "$GITHUB_WORKSPACE/work" + key: "${{ runner.os }}-buildtools" + restore-keys: | + "${{ runner.os }}-buildtools" + - name: "Test Enviornment" + run: "echo $GITHUB_WORKSPACE" + - name: "Download BuildTools" + run: "wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" + - name: "Run BuildTools" + run: "java -jar BuildTools.jar --rev 1.16.4" + - name: "Clean Build" + run: "./gradlew clean build sourcesJar javadocJar" + diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 3e22a4ebb..000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Java CI - -on: - push: - branches: - - 'main' - pull_request: - branches: - - 'main' - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - java: [1.8, 1.11] - - steps: - - name: Checkout - uses: actions/checkout@v2.3.2 - - name: Setup Java JDK - uses: actions/setup-java@v1.4.2 - with: - java-version: ${{ matrix.java }} - - name: Cache Gradle - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.java }}-gradle- - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.java }}-maven- - - name: Cache BuildTools decompiled code - uses: actions/cache@v2 - with: - path: $GITHUB_WORKSPACE/work - key: ${{ runner.os }}-buildtools - restore-keys: | - ${{ runner.os }}-buildtools - - name: Test enviornment - run: echo $GITHUB_WORKSPACE - - name: Download BuildTools - run: wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - - name: Run BuildTools - run: java -jar BuildTools.jar --rev 1.16.4 - - name: Test with Gradle - run: ./gradlew clean build sourcesJar javadocJar - diff --git a/.github/workflows/validate-gradle-wrapper.yml b/.github/workflows/validate-gradle-wrapper.yml new file mode 100644 index 000000000..b4c46f704 --- /dev/null +++ b/.github/workflows/validate-gradle-wrapper.yml @@ -0,0 +1,12 @@ +name: "validate gradle wrapper" + +on: ["pull_request", "push"] + +jobs: + build: + runs-on: "ubuntu-18.04" + steps: + - name: "Checkout Repository" + uses: "actions/checkout@v2.3.4" + - name: "Validate Gradle Wrapper" + uses: "gradle/wrapper-validation-action@v1.0.3" \ No newline at end of file