Only run build on PR (no publishing)

This commit is contained in:
comp500 2023-04-12 23:52:54 +01:00
parent 1deed7dd0d
commit cc063773d8
2 changed files with 31 additions and 1 deletions

27
.github/workflows/pr.yml vendored Normal file
View File

@ -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

View File

@ -1,6 +1,9 @@
name: Java Gradle Snapshot
on: ["push", "pull_request"]
on:
push:
branches:
- 'main'
jobs:
build: