Skip to content

Commit

Permalink
Polish GHA config (#517)
Browse files Browse the repository at this point in the history
- Updates actions.
- Use gradle-build-action to cache Gradle and speed up builds.
- Let CI run for more PRs and branches.
  • Loading branch information
Goooler committed Oct 31, 2023
1 parent 931fc5d commit 1cd6572
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
Expand All @@ -15,18 +15,7 @@ jobs:
- 17

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
**/build-cache
!tmp
key: v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-
- uses: actions/checkout@v4

- name: Import snapshot GPG key
run: |
Expand Down Expand Up @@ -59,19 +48,19 @@ jobs:
github.ref != 'refs/heads/master'
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'zulu'

- name: Cache Gradle
uses: gradle/gradle-build-action@v2

- name: Build and test
uses: eskatos/gradle-command-action@v1
with:
arguments: check
run: ./gradlew check

- name: Deploy snapshot
uses: eskatos/gradle-command-action@v1
with:
arguments: uploadSnapshot
run: ./gradlew uploadSnapshot
if: >-
github.event_name == 'push' &&
github.repository == 'KeepSafe/dexcount-gradle-plugin' &&
Expand Down

0 comments on commit 1cd6572

Please sign in to comment.