refactor(rebrand): Centralize branding configuration in template.prop… #18
This file contains hidden or 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: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| # Cancel previous runs if a new one is started | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| name: Test & Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: false | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Create google-services.json | |
| run: | | |
| echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > app/google-services.json | |
| - name: Run unit tests | |
| run: ./gradlew test --parallel --build-cache --configuration-cache --stacktrace | |
| - name: Run Detekt | |
| run: ./gradlew detekt --parallel --build-cache --configuration-cache --stacktrace | |
| - name: Run Android Lint | |
| run: ./gradlew lint --parallel --build-cache --configuration-cache --stacktrace | |
| - name: Upload test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: | | |
| **/build/test-results/ | |
| **/build/reports/tests/ | |
| retention-days: 7 | |
| - name: Upload lint reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-reports | |
| path: | | |
| **/build/reports/lint-results*.html | |
| **/build/reports/lint-results*.xml | |
| retention-days: 7 | |
| build: | |
| name: Build ${{ matrix.flavor }}${{ matrix.buildType }} | |
| runs-on: ubuntu-latest | |
| needs: verify | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| flavor: [Dev, Prod] | |
| buildType: [Debug, Release] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: false | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Create google-services.json | |
| run: | | |
| echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > app/google-services.json | |
| - name: Build ${{ matrix.flavor }}${{ matrix.buildType }} APK | |
| run: ./gradlew assemble${{ matrix.flavor }}${{ matrix.buildType }} --parallel --build-cache --configuration-cache --stacktrace | |
| - name: Upload ${{ matrix.flavor }}${{ matrix.buildType }} APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.flavor }}-${{ matrix.buildType }}-apk | |
| path: app/build/outputs/apk/**/*.apk | |
| retention-days: ${{ matrix.buildType == 'Release' && 14 || 7 }} | |