Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Try using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Banes committed Nov 13, 2019
1 parent 7542304 commit 606da69
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Xmx5120m
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process
TERM: dumb

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Decrypt secrets
run: release/signing-setup.sh $ENCRYPT_KEY
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v1
with:
path: ~/.gradle/caches/modules-2
key: ${{ runner.os }}-gradlemodules-${{ hashFiles('checksum.txt') }}
restore-keys: |
${{ runner.os }}-gradlemodules-
- uses: actions/cache@v1
with:
path: ~/.gradle/caches/jars-3
key: ${{ runner.os }}-gradlejars-${{ hashFiles('checksum.txt') }}
restore-keys: |
${{ runner.os }}-gradlejars-
- uses: actions/cache@v1
with:
path: ~/.gradle/caches/build-cache-1
key: ${{ runner.os }}-gradlebuildcache-${{ hashFiles('checksum.txt') }}
restore-keys: |
${{ runner.os }}-gradlebuildcache-
- name: Run Spotless Check
run: ./gradlew spotlessCheck --scan

- name: Build
run: ./gradlew assemble --scan

- name: Run tests
run: ./gradlew testDebug --scan

- name: Run Lint
run: ./gradlew lintDebug dependencyUpdates --scan

- name: Deploy to Sonatype
if: github.ref == 'refs/heads/master'
run: ./gradlew uploadArchives --no-parallel
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

- name: Clean secrets
if: always()
run: release/signing-cleanup.sh

- name: Upload build outputs
if: always()
uses: actions/upload-artifact@v1
with:
name: build-outputs
path: app/build/outputs

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v1
with:
name: build-reports
path: app/build/reports

- name: Upload dependency updates report
uses: actions/upload-artifact@v1
with:
name: dependency-updates
path: build/dependencyUpdates

- name: Copy test results
if: always()
run: |
mkdir -p junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} junit/ \;
- name: Upload test results
if: always()
uses: actions/upload-artifact@v1
with:
name: junit-results
path: junit

0 comments on commit 606da69

Please sign in to comment.