chore : checking #2
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 | |
paths-ignore: | |
- "docs/**" | |
- "doc/**" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "doc/**" | |
concurrency: | |
group: build-2-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality: | |
name: Verify Code Quality | |
runs-on: ubuntu-latest | |
env: | |
KONAN_DATA_DIR: ~/.gradle/caches/.konan | |
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 ] | |
env: | |
KONAN_DATA_DIR: ~/.gradle/caches/.konan | |
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 ] | |
env: | |
KONAN_DATA_DIR: ~/.gradle/caches/.konan | |
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: Lint Swift | |
run: | | |
bundle exec fastlane ios lint | |
- 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 | |
# 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 | |
# xcodebuild clean test \ | |
# -project iosApp/iosApp.xcodeproj \ | |
# -configuration Debug \ | |
# -scheme iosApp \ | |
# -sdk iphoneos \ | |
# -destination name='iPhone 14 Pro' \ | |
# -test-timeouts-enabled YES \ | |
# build | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
coverage-report: | |
name: Code coverage report & verification | |
runs-on: macos-13 | |
needs: [ build-android, build-ios ] | |
env: | |
KONAN_DATA_DIR: ~/.gradle/caches/.konan | |
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 | |
# - name: Push new screenshots if available | |
# uses: stefanzweifel/git-auto-commit-action@v4 | |
# if: steps.screenshotsrecord.outcome == 'success' | |
# with: | |
# file_pattern: '*/*.png' | |
# disable_globbing: true | |
# commit_message: "🤖 Updates screenshots" |