-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Android Lint & Unit Test flow | ||
|
||
# Choose the branch or branches you want to run this workflow | ||
on: push | ||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: macOS-latest | ||
steps: | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
linting: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Load Gradle cached | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# Check the code with Android linter | ||
- name: Run Android Linter | ||
run: ./gradlew app:lintStagingDebug data:lintStagingDebug | ||
|
||
# Archive lint report | ||
- name: Archive Lint reports | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: lint-report | ||
path: | | ||
app/build/reports/*.html | ||
data/build/reports/*.html | ||
detekt: | ||
name: Detekt - Static Code Analysis | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Load Gradle cached | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Run Detekt | ||
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: detekt-report | ||
path: build/reports/detekt/ | ||
|
||
unitTest: | ||
name: Jacoco - Unit Test & CodeCov | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Load Gradle cached | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Run Unit Tests & Jacoco | ||
run: ./gradlew jacocoTestReport | ||
|
||
# Archive Unit test & code coverage report | ||
- name: Archive Code coverage report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code-coverage-report | ||
path: | | ||
app/build/reports/jacoco/jacocoTestReport/ | ||
data/build/reports/jacoco/jacocoTestReport/ |