GitHub actions cleanup #218
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
types: [ opened, synchronize ] | |
concurrency: | |
group: ci-${{ github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }} | |
TMDB_API_URL: ${{ secrets.TMDB_API_URL }} | |
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }} | |
TRAKT_CLIENT_SECRET: ${{ secrets.TRAKT_CLIENT_SECRET }} | |
TRAKT_REDIRECT_URI: ${{ secrets.TRAKT_REDIRECT_URI }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 18 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Add App Secrets | |
run: | | |
echo -e "\TMDB_API_KEY=$TMDB_API_KEY" >> ./local.properties | |
echo -e "\TMDB_API_URL=$TMDB_API_URL" >> ./local.properties | |
echo -e "\TRAKT_CLIENT_ID=$TRAKT_CLIENT_ID" >> ./local.properties | |
echo -e "\TRAKT_CLIENT_SECRET=$TRAKT_CLIENT_SECRET" >> ./local.properties | |
echo -e "\TRAKT_REDIRECT_URI=$TRAKT_REDIRECT_URI" >> ./local.properties | |
android-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 18 | |
- name: lintDebug | |
run: ./gradlew lint | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: android-lint-report | |
path: ~/**/build/reports/lint-results*.html | |
spotless: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 18 | |
distribution: 'zulu' | |
- name: spotless | |
run: ./gradlew spotlessCheck --init-script tooling/checks/spotless.gradle.kts --no-configuration-cache | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: detekt-report | |
path: ./**/build/reports/detekt/detekt.* | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 18 | |
distribution: 'zulu' | |
- name: unitTest | |
run: ./gradlew testDemoDebug | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: unit-test-report | |
path: ./**/build/reports/tests/ | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 18 | |
distribution: 'zulu' | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: android/app/build/outputs/apk/demo/debug/app-demo-debug.apk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload build outputs (APKs) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-outputs | |
path: android/app/build/outputs |