chore : checking #68
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: Build NetWorth (Build Test & Check) | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality: | |
name: Verify Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Code Quality | |
run: ./gradlew detekt ktlintCheck | |
build-android: | |
name: Build, Test & Check (Android) | |
runs-on: ubuntu-latest | |
needs: [ code-quality ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Build android app | |
run: ./gradlew assembleDebug | |
- name: Run Android Unit Tests | |
run: ./gradlew :androidApp:testDebugUnitTest | |
- name: Run Lint | |
run: ./gradlew :androidApp:lintDebug | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: "**/build/reports/kover/report.xml" | |
build-ios: | |
name: Build, Test & Check (iOS) | |
runs-on: macos-13 | |
needs: [ code-quality ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Setup XCode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- name: Setup Fastlane | |
run: bundle install | |
- name: Decrypt large secret | |
run: | | |
./.github/scripts/decrypt_secret.sh | |
env: | |
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} | |
- name: Build iOS app | |
env: | |
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
CI: true | |
run: | | |
bundle exec fastlane ios build_for_test | |
# run: | | |
# xcodebuild \ | |
# -project iosApp/iosApp.xcodeproj \ | |
# -configuration Debug \ | |
# -scheme iosApp \ | |
# -sdk iphoneos \ | |
# -destination name='iPhone 14 Pro' \ | |
# build | |
- name: Run iOS unit tests | |
env: | |
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
CI: true | |
run: | | |
bundle exec fastlane ios test_without_building | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
# run: | | |
# xcodebuild clean test \ | |
# -project iosApp/iosApp.xcodeproj \ | |
# -configuration Debug \ | |
# -scheme iosApp \ | |
# -sdk iphoneos \ | |
# -destination name='iPhone 14 Pro' \ | |
# -test-timeouts-enabled YES \ | |
# build | |
coverage-report: | |
name: Code coverage report & verification | |
runs-on: macos-12 | |
needs: [ build-android, build-ios ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Run all tests | |
run: ./gradlew allTests | |
- name: Generate Coverage Report | |
run: ./gradlew koverXmlReport | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: "**/build/reports/kover/report.xml" | |
# androidTest: | |
# runs-on: macos-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - name: Set up JDK 17 | |
# uses: actions/setup-java@v3 | |
# with: | |
# distribution: 'zulu' | |
# java-version: 17 | |
# | |
# - name: Android Instrumentation Tests | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# with: | |
# api-level: 29 | |
# target: google_apis | |
# script: ./gradlew androidApp:connectedAndroidTest |