fix: category grid padding. #1125
Workflow file for this run
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 For Build and Coverage Check | |
| on: | |
| pull_request: | |
| types: [ opened, edited, synchronize, reopened ] | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Grant Permission to Gradle | |
| run: chmod +x ./gradlew | |
| - name: Create google-services.json for Test Job | |
| env: | |
| GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
| run: | | |
| mkdir -p app/ | |
| echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json | |
| shell: bash | |
| - name: Build Project | |
| env: | |
| KEYSTORE: ${{ secrets.KEYSTORE }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| MOVIES_API_KEY: ${{ secrets.MOVIES_API_KEY }} | |
| IMAGE_BASE_URL: ${{secrets.IMAGE_BASE_URL}} | |
| run: | | |
| # Cleanup existing files | |
| rm -f app/movio-cairo.jks local.properties release_notes.txt | |
| # Decode keystore and verify | |
| echo "$KEYSTORE" | base64 -d > app/movio-cairo.jks | |
| # Create local.properties with necessary properties | |
| echo "BASE_URL = \"https://api.themoviedb.org/3/\"" >> local.properties | |
| echo "KEYSTORE_FILE = movio-cairo.jks" >> local.properties | |
| echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties | |
| echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties | |
| echo "KEY_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties | |
| echo "API_KEY = \"$MOVIES_API_KEY\"" >> local.properties | |
| echo "IMAGE_BASE_URL = \"$IMAGE_BASE_URL\"" >> local.properties | |
| # Build signed release APK | |
| ./gradlew assembleDebug --build-cache | |
| test: | |
| name: Verify Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Grant Permission to Gradle | |
| run: chmod +x ./gradlew | |
| - name: Create google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
| run: | | |
| mkdir -p app/ # Ensure the directory exists | |
| echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json | |
| shell: bash | |
| - name: Run Tests + Generate Kover Report | |
| env: | |
| KEYSTORE: ${{ secrets.KEYSTORE }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| MOVIES_API_KEY: ${{ secrets.MOVIES_API_KEY }} | |
| IMAGE_BASE_URL: ${{secrets.IMAGE_BASE_URL}} | |
| run: | | |
| # Cleanup existing files | |
| rm -f app/movio-cairo.jks local.properties release_notes.txt | |
| # Decode keystore and verify | |
| echo "$KEYSTORE" | base64 -d > app/movio-cairo.jks | |
| # Create local.properties with necessary properties | |
| echo "BASE_URL = \"https://api.themoviedb.org/3/\"" >> local.properties | |
| echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties | |
| echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties | |
| echo "KEY_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties | |
| echo "API_KEY = \"$MOVIES_API_KEY\"" >> local.properties | |
| echo "IMAGE_BASE_URL = \"$IMAGE_BASE_URL\"" >> local.properties | |
| # Build signed release APK | |
| ./gradlew test koverHtmlReport --build-cache | |
| - name: Enforce 80% Coverage | |
| run: ./gradlew koverVerify --build-cache | |
| - name: Upload Test Results (JUnit XML) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: '**/build/test-results/**/*.xml' | |
| - name: Upload HTML Coverage Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kover-html-report | |
| path: build/reports/kover/html/ | |
| comment-on-pr: | |
| name: Test Results | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| steps: | |
| - name: Download Test Results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: test-results | |
| path: test-results | |
| - name: Publish Results as PR Comment | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: test-results/**/*.xml | |
| confirm-coverage: | |
| name: Confirm Coverage Upload | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Download HTML Report | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: kover-html-report | |
| path: build/reports/kover/html/ | |
| - name: Confirm Coverage Artifact | |
| run: echo "Kover HTML report is uploaded successfully." |