From 47427d9eb798806d9a70242b144f19f165402430 Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:52:03 +0200 Subject: [PATCH 1/2] update GHA - enable concurrency cancellation (so newer commits will cancel previous commits - use gradle/gradle-build-action (supports Gradle build & config caches) - bump actions/setup-java --- .github/workflows/build.yml | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c114fb..8b7d14f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,10 @@ name: Build -on: [push] + +on: [ push ] + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true jobs: build: @@ -7,16 +12,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - java-version: 11 - distribution: adopt - cache: gradle - - name: Build with Gradle - run: | - ./gradlew assemble - - name: Test with Gradle - run: | - unset GITHUB_ACTIONS - ./gradlew test + - uses: actions/checkout@v2 + + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: adopt + + - uses: gradle/gradle-build-action@v2 + + - name: Build with Gradle + run: | + ./gradlew assemble + + - name: Test with Gradle + run: | + unset GITHUB_ACTIONS + ./gradlew test From b3953b4528806e59ca9ecb843ce0cfac559b3127 Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:54:53 +0200 Subject: [PATCH 2/2] enable triggering the build on pull requests or manually --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b7d14f..5a7cab3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: Build -on: [ push ] +on: + push: + pull_request: + workflow_dispatch: concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'