76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: Build & Test
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '**'
|
|
- '!**.md'
|
|
- '!fastlane/**'
|
|
- '!i18n/src/commonMain/moko-resources/**/strings.xml'
|
|
- '!i18n/src/commonMain/moko-resources/**/plurals.xml'
|
|
- 'i18n/src/commonMain/moko-resources/base/strings.xml'
|
|
- 'i18n/src/commonMain/moko-resources/base/plurals.xml'
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & Test App
|
|
runs-on: 'ubuntu-24.04'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Dependency Review
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
|
|
with:
|
|
java-version-file: .github/.java-version
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
|
|
|
|
- name: Check code format
|
|
run: ./gradlew spotlessCheck
|
|
|
|
- name: Run unit tests
|
|
id: unit_tests
|
|
run: ./gradlew testDebugUnitTest
|
|
|
|
- name: Verify SQLDelight migrations
|
|
run: ./gradlew verifySqlDelightMigration
|
|
|
|
- name: Upload test report
|
|
if: steps.unit_tests.outcome == 'failure'
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: test-report-${{ github.sha }}
|
|
path: app/build/reports/tests/testDebugUnitTest
|
|
|
|
- name: Build app
|
|
run: ./gradlew assembleRelease -Pinclude-telemetry -Penable-updater
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: arm64-v8a-${{ github.sha }}
|
|
path: app/build/outputs/apk/release/app-arm64-v8a-release.apk
|
|
|
|
- name: Upload mapping
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: mapping-${{ github.sha }}
|
|
path: app/build/outputs/mapping/release
|