.github/workflows/checks.yml
name: "Checks"
on:
pull_request:
branches:
- main
# Cancel any current or previous job from the same PR
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
changed:
runs-on: ubuntu-24.04
outputs:
android: ${{ steps.changes.outputs.android }}
ios: ${{ steps.changes.outputs.ios }}
backend: ${{ steps.changes.outputs.backend }}
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# https://github.com/marketplace/actions/paths-changes-filter
- name: Paths Changes Filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
android:
- 'app/android/**/*'
- 'app/shared/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'feature/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
ios:
- 'app/ios/**/*'
- 'app/ios-combined/**/*'
- 'app/shared/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'feature/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
backend:
- 'app/backend/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
check-android:
runs-on: ubuntu-24.04
needs: changed
if: needs.changed.outputs.android == 'true'
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: 'true'
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Unit Tests
run: ./gradlew testDebugUnitTest
- name: Build
run: ./gradlew :app:android:assembleDevDebug
check-ios:
runs-on: macos-14
needs: changed
if: needs.changed.outputs.ios == 'true'
strategy:
matrix:
destination: [ 'platform=iOS Simulator,OS=17.2,name=iPhone 15' ]
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
# https://github.com/marketplace/actions/setup-xcode-version
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '15.1.0'
- name: Build iOS framework
run: ./gradlew :app:ios-combined:assembleNitoKmpReleaseXCFramework
- name: Run iOS unit tests
continue-on-error: true
run: xcodebuild clean build -project app/ios/App/Nito/Nito.xcodeproj -configuration Debug -scheme Dev -sdk iphoneos -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -test-timeouts-enabled YES
env:
destination: ${{ matrix.destination }}
check-backend:
runs-on: ubuntu-24.04
needs: changed
if: needs.changed.outputs.backend == 'true'
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: 'true'
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Unit Tests
run: ./gradlew :app:backend:check
- name: Build
run: ./gradlew :app:backend:buildFatJar
status-check:
runs-on: ubuntu-24.04
needs:
- check-android
- check-ios
- check-backend
permissions: { }
if: failure()
steps:
- run: exit 1