From cc063773d889992cd56637f347f7f709bc50c4d1 Mon Sep 17 00:00:00 2001 From: comp500 <comp500@users.noreply.github.com> Date: Wed, 12 Apr 2023 23:52:54 +0100 Subject: [PATCH] Only run build on PR (no publishing) --- .github/workflows/pr.yml | 27 +++++++++++++++++++++++++++ .github/workflows/snapshot.yml | 5 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..bd85125 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +name: Java Gradle Build + +on: + pull_request + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'temurin' + cache: gradle + - name: Build with Gradle + run: ./gradlew build + - name: Cleanup Gradle Cache + # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. + # Restoring these files from a GitHub Actions cache might cause problems for future builds. + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index e519b12..24d056a 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -1,6 +1,9 @@ name: Java Gradle Snapshot -on: ["push", "pull_request"] +on: + push: + branches: + - 'main' jobs: build: