Skip to content

chore : checking

chore : checking #100

Workflow file for this run

name: Build NetWorth (Build Test & Check)
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "doc/**"
pull_request:
paths-ignore:
- "docs/**"
- "doc/**"
concurrency:
group: build-${{ 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: Setup Kotlin/Native compile(Konan) Cache
if: always()
uses: actions/cache@v3
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-macos-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan-
- 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: Setup Kotlin/Native compile(Konan) Cache
if: always()
uses: actions/cache@v3
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-macos-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan-
- 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-12
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 Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Setup Fastlane
run: |
cd ./iosApp
bundle install
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Decrypt large secret
run: |
./.github/scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- name: Setup Kotlin/Native compile(Konan) Cache
if: always()
uses: actions/cache@v3
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-macos-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan-
- name: Cache iOS packages
if: always()
uses: actions/cache@v3
id: packages-cache
with:
path: packages_cache
key: ${{ runner.os }}-packages-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-packages-
- 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-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: Setup Kotlin/Native compile(Konan) Cache
if: always()
uses: actions/cache@v3
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-macos-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan-
- 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-12
# 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"