From a76e8eb6d2c0563af3fef8571c521a4cc608cdcb Mon Sep 17 00:00:00 2001 From: Francis Duvivier Date: Tue, 29 Sep 2020 22:18:40 +0200 Subject: [PATCH 1/3] Restrict android build action to when android files changed --- .github/workflows/gradle.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1f3df8216..0e146ee81 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -6,8 +6,14 @@ name: Java CI with Gradle on: push: branches: [ master ] + paths: + - 'android/**' + - '.github/workflows/gradle.yml' pull_request: branches: [ master ] + paths: + - 'android/**' + - '.github/workflows/gradle.yml' jobs: build: From 77c1225ccf3b3251aa54cd3cf9f117e931ab79f9 Mon Sep 17 00:00:00 2001 From: Francis Duvivier Date: Tue, 29 Sep 2020 23:04:19 +0200 Subject: [PATCH 2/3] Enable android build in github action --- .github/workflows/gradle.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0e146ee81..964ad2023 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -34,7 +34,7 @@ jobs: run: | cd android ./gradlew lint - # - name: Build - # run: | - # cd android - # ./gradlew build + - name: Build + run: | + cd android + ./gradlew build From 866be02e7b5b0bd86a96b8955ffb183c228c0050 Mon Sep 17 00:00:00 2001 From: Francis Duvivier Date: Tue, 29 Sep 2020 23:36:46 +0200 Subject: [PATCH 3/3] Use cache in gradle Action to speed up build --- .github/workflows/gradle.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 964ad2023..eac23aecf 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -26,6 +26,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle - name: Style run: | cd android