Skip to content

feat: Refactor location handling and weather data fetching in the app #8

feat: Refactor location handling and weather data fetching in the app

feat: Refactor location handling and weather data fetching in the app #8

Workflow file for this run

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