feat: Refactor location handling and weather data fetching in the app #8
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: Android Code Coverage | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| test-and-coverage: | |
| name: Run Unit Tests & Collect Coverage | |
| runs-on: ubuntu-latest | |
| env: | |
| OPEN_WEATHER_API_KEY: ${{ secrets.OPEN_WEATHER_API_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Grant execute permission to Gradlew | |
| run: chmod +x ./gradlew | |
| - name: Run Unit Tests with Coverage | |
| run: ./gradlew jacocoTestReport | |
| - name: Upload Coverage Report as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: app/build/reports/jacoco/jacocoTestReport/html/ | |
| # Optional: Fail build if coverage is too low | |
| # - name: Enforce minimum coverage (experimental, optional) | |
| # run: ./scripts/checkCoverageThreshold.sh |