summaryrefslogtreecommitdiff
path: root/.github/workflows/ios.yml
blob: d438c00f7fa98045ef74a1b2ccec772d54e2bfff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: ios

on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  ios-build:
    runs-on: macos-14
    steps:
      - uses: actions/checkout@v4

      - name: Gradle & Konan cache (warm build across runs)
        uses: actions/cache@v4
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            ~/.konan
          key: ios-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties', '**/*.gradle.kts') }}
          restore-keys: |
            ios-${{ runner.os }}-

      - name: JDK 21
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: '21'

      - name: Compile iOS targets
        run: |
          chmod +x gradlew
          ./gradlew :modules:orgflow-domain:compileKotlinIosArm64 \
                    :modules:orgflow-domain:compileKotlinIosSimulatorArm64 \
                    :modules:orgflow-domain:compileKotlinIosX64 \
                    :modules:orgflow-domain:linkDebugFrameworkIosArm64 \
                    :modules:orgflow-domain:linkDebugFrameworkIosSimulatorArm64 \
                    --no-daemon

      - name: Simulator tests
        run: ./gradlew :modules:orgflow-domain:iosSimulatorArm64Test --no-daemon

      - name: Collect frameworks
        if: always()
        run: |
          mkdir -p out
          # frameworks live in build/bin/<target>/<mode>Framework, klibs in
          # build/classes/kotlin/<target>/*/  (compile tasks only emit klibs)
          find modules/orgflow-domain/build \( -name "*.framework" -o -name "*.klib" \) | while read f; do
            cp -r "$f" out/ 2>/dev/null || true
          done
          ls out || true

      - uses: actions/upload-artifact@v4
        with:
          name: kukuri-ios
          path: out
          if-no-files-found: error