Merge pull request #15 from jarroyoesp/feature/android-navigation #76
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
name: CI | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
branches: | |
- master | |
jobs: | |
build-release: | |
name: Build release | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
TERM: dumb | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17.0.6 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
## Actual task | |
- name: Build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: assembleRelease | |
static-analysis: | |
name: Static analysis and Unit tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
TERM: dumb | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17.0.6 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: assembleDebug -PsaveBuildLogToFile=true | |
## Actual tasks | |
- name: Detekt | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: detektMain detektTest | |
- name: Spotless | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: spotlessCheck | |
- name: Lint | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: lint | |
- name: Upload Lint results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: static-analysis-list-results | |
path: ./**/build/reports/lint-results-*.html | |
- name: Unit tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: testDebugUnitTest | |
- name: Publishing violation comments to PR | |
if: ${{ always() && github.event_name == 'pull_request' }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: violationCommentsToGitHub -DGITHUB_PULLREQUESTID=${{ github.event.number }} -DGITHUB_OAUTH2TOKEN=${{ secrets.GITHUB_TOKEN }} --info |