Skip to content

Commit

Permalink
Merge pull request #18 from azizutku/github-workflow
Browse files Browse the repository at this point in the history
Create build workflow
  • Loading branch information
azizutku committed Aug 8, 2023
2 parents 64fa93d + 5444da5 commit 4958437
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build.yml
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'

0 comments on commit 4958437

Please sign in to comment.