Skip to content

Commit

Permalink
Simplified build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aneonex committed Nov 21, 2021
1 parent c587811 commit d29773d
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle
name: Android CI

on:
push:
Expand All @@ -15,36 +15,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout source code
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt' # Adopt OpenJDK

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
distribution: 'adopt'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties

0 comments on commit d29773d

Please sign in to comment.