Skip to content

chore : move android tasks to fastlane #108

chore : move android tasks to fastlane

chore : move android tasks to fastlane #108

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: ${{ github.workflow }}-${{ github.event.pull_request.number || 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: |
bundle exec fastlane android build
- name: Run Lint
run: ./gradlew :androidApp:lintDebug
- name: Run Android Unit Tests
run: |
bundle exec fastlane android test
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: |
bundle exec fastlane android androidTests
- 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:
name: Run Android UI Test
runs-on: macos-12
needs: [ build-android, build-ios ]
timeout-minutes: 55
strategy:
matrix:
api-level: [ 26, 30 ]
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 instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: |
bundle exec fastlane android androidTests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: "**/build/reports/kover/report.xml"
# - 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"