From 0412f2d9e2a366dcb9250b04e2ed7f9905ab019e Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 9 Mar 2022 17:25:53 +0800 Subject: [PATCH] Use gradle/gradle-build-action --- .github/workflows/android-build.yml | 9 ++++++--- .../workflows/android-debug-artifact-ondemand.yml | 6 +++--- .../workflows/android-debug-artifact-release.yml | 5 +++-- .github/workflows/android-feature.yml | 13 +++++++++---- .github/workflows/android-main.yml | 13 +++++++++---- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 70e1814b0..bb448cf9d 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -23,7 +23,9 @@ jobs: java-version: 11 cache: 'gradle' - name: Check formatting using spotless - run: ./gradlew spotlessCheck --stacktrace + uses: gradle/gradle-build-action@v2 + with: + arguments: spotlessCheck --stacktrace build: name: Build debug @@ -37,5 +39,6 @@ jobs: java-version: 11 cache: 'gradle' - name: Build with Gradle - run: | - ./gradlew assembledebug --stacktrace \ No newline at end of file + uses: gradle/gradle-build-action@v2 + with: + arguments: assembledebug --stacktrace \ No newline at end of file diff --git a/.github/workflows/android-debug-artifact-ondemand.yml b/.github/workflows/android-debug-artifact-ondemand.yml index 56aa9fee8..c823124a2 100644 --- a/.github/workflows/android-debug-artifact-ondemand.yml +++ b/.github/workflows/android-debug-artifact-ondemand.yml @@ -37,9 +37,9 @@ jobs: java-version: 11 cache: 'gradle' - name: Build with Gradle - run: | - echo Run on-demand by ${GITHUB_ACTOR} - bash ./gradlew assembleDebug --stacktrace + uses: gradle/gradle-build-action@v2 + with: + arguments: assembleDebug --stacktrace - name: Upload fdroid artifact uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/android-debug-artifact-release.yml b/.github/workflows/android-debug-artifact-release.yml index 50f7d7f02..d7a9ca116 100644 --- a/.github/workflows/android-debug-artifact-release.yml +++ b/.github/workflows/android-debug-artifact-release.yml @@ -16,8 +16,9 @@ jobs: java-version: 11 cache: 'gradle' - name: Build with Gradle - run: | - bash ./gradlew assembleDebug + uses: gradle/gradle-build-action@v2 + with: + arguments: assembleDebug - name: Upload fdroid artifact uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/android-feature.yml b/.github/workflows/android-feature.yml index 00a6894e1..d2195239e 100644 --- a/.github/workflows/android-feature.yml +++ b/.github/workflows/android-feature.yml @@ -24,7 +24,9 @@ jobs: java-version: 11 cache: 'gradle' - name: Check formatting using spotless - run: ./gradlew spotlessCheck --stacktrace + uses: gradle/gradle-build-action@v2 + with: + arguments: spotlessCheck --stacktrace build: name: Build debug and run Jacoco tests runs-on: ubuntu-20.04 @@ -37,7 +39,10 @@ jobs: java-version: 11 cache: 'gradle' - name: Build with Gradle - run: | - ./gradlew assembledebug --stacktrace + uses: gradle/gradle-build-action@v2 + with: + arguments: assembledebug --stacktrace - name: Run test cases - run: ./gradlew jacocoTestPlayDebugUnitTestReport --stacktrace --info \ No newline at end of file + uses: gradle/gradle-build-action@v2 + with: + arguments: jacocoTestPlayDebugUnitTestReport --stacktrace --info \ No newline at end of file diff --git a/.github/workflows/android-main.yml b/.github/workflows/android-main.yml index 48fe4a380..2337077bc 100644 --- a/.github/workflows/android-main.yml +++ b/.github/workflows/android-main.yml @@ -23,7 +23,9 @@ jobs: java-version: 11 cache: 'gradle' - name: Check formatting using spotless - run: ./gradlew spotlessCheck + uses: gradle/gradle-build-action@v2 + with: + arguments: spotlessCheck build: name: Build debug, Jacoco test and publish to codacy runs-on: ubuntu-20.04 @@ -38,10 +40,13 @@ jobs: java-version: 11 cache: 'gradle' - name: Build with Gradle - run: | - ./gradlew assembledebug + uses: gradle/gradle-build-action@v2 + with: + arguments: assembledebug - name: Run test cases - run: ./gradlew jacocoTestPlayDebugUnitTestReport + uses: gradle/gradle-build-action@v2 + with: + arguments: jacocoTestPlayDebugUnitTestReport - name: Publish test cases run: | export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_TOKEN }}