From 639771b9758f1e36c34ed99994ba2c03a0a361ec Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 11 Sep 2021 20:07:17 -0700 Subject: Github Actions (#266) --- .github/workflows/android.yml | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/android.yml (limited to '.github') diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..25a2499 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,54 @@ +name: Android CI + +on: + push: + branches: [ '*' ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 100 + + - name: Fetch all tags + run: git fetch origin +refs/tags/*:refs/tags/* + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + java-package: jdk + distribution: 'adopt' + cache: gradle + + - name: Validate gradle wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Decrypt secret + if: ${{ false }} + run: | + gpg -d --passphrase "${{ secrets.KAU_TAR_SECRET }}" --batch "files/kau_github.tar.gpg" > "files/kau_github.tar" + tar xvf files/kau_github.tar -C files + + - name: Checkout Gradle Build Cache + if: ${{ steps.self_hosted.outputs.FLAG != 'self-hosted' }} + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + !~/.gradle/wrapper/dists/**/gradle*.zip + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + gradle-${{ runner.os }}- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Check and Test + run: ./gradlew spotlessCheck lintRelease testReleaseUnitTest -- cgit v1.2.3