-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from azizutku/github-workflow
Create build workflow
- Loading branch information
Showing
1 changed file
with
73 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,73 @@ | ||
name: Build CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
env: | ||
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process" | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Project | ||
uses: actions/[email protected] | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/[email protected] | ||
|
||
- name: Configure JDK | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Access TMDB_API_KEY | ||
env: | ||
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }} | ||
run: echo tmdb.api.key=$TMDB_API_KEY > ./local.properties | ||
|
||
- name: Run build with caching enabled | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: clean assembleDevDebug -s | ||
|
||
- name: Run Detekt | ||
run: ./gradlew detektDevDebug | ||
|
||
- name: Check lint | ||
run: ./gradlew lintDevDebug | ||
|
||
- name: Run local tests | ||
run: ./gradlew testDevDebugUnitTest | ||
|
||
- name: Upload detekt reports (HTML) | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: detekt-reports | ||
path: '**/build/reports/detekt/report.html' | ||
|
||
- name: Upload lint reports (HTML) | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: lint-reports | ||
path: '**/build/reports/lint-results-*.html' | ||
|
||
- name: Upload test results (XML) | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: test-results | ||
path: '**/build/test-results/test*UnitTest/**.xml' | ||
|