Skip to content

Create build workflow #2

Create build workflow

Create build workflow #2

Workflow file for this run

name: Build CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3.5.3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1.1.0
- name: Configure JDK
uses: actions/setup-java@v3.12.0
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/gradle-build-action@v2.7.0
with:
arguments: clean build -s
- name: Run Detekt
run: ./gradlew detektMain
- name: Run local tests
run: ./gradlew testDevDebugUnitTest