Create build workflow #1
Workflow file for this run
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: 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/[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 build -s | |
- name: Run Detekt | |
run: ./gradlew detektMain | |
- name: Run local tests | |
run: ./gradlew testDevDebugUnitTest |