From 1cd657256e628c929bca82e2a8d3c100d246a6bc Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 1 Nov 2023 02:13:42 +0800 Subject: [PATCH] Polish GHA config (#517) - Updates actions. - Use gradle-build-action to cache Gradle and speed up builds. - Let CI run for more PRs and branches. --- .github/workflows/ci.yml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a9597..15fd755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] + workflow_dispatch: jobs: build: @@ -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: | @@ -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' &&