Skip to content

Chore(deps): Bump actions/cache/save from 5.0.5 to 6.1.0 (#490) #842

Chore(deps): Bump actions/cache/save from 5.0.5 to 6.1.0 (#490)

Chore(deps): Bump actions/cache/save from 5.0.5 to 6.1.0 (#490) #842

Workflow file for this run

name: iOS CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
env:
XCODE_VERSION: '16.4'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
ios: ${{ steps.filter.outputs.ios }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check paths
id: filter
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
with:
filters: |
ios:
- 'iosApp/**'
- 'shared/**'
- 'gradle/**'
- '*.gradle.kts'
- 'gradle.properties'
- 'gradlew'
- 'gradlew.bat'
- '.github/workflows/ios.yml'
build-and-test:
name: Build & Test
needs: [changes]
if: needs.changes.outputs.ios == 'true'
runs-on: macos-15
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 17
uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
with:
distribution: temurin
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@cf4beec8b4cca436a7b646657f74edc125658df8 # v6.1.1
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Prepare iOS Simulator
id: sim
uses: ./.github/actions/prepare-ios-simulator
- name: Cache Kotlin/Native toolchain
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.konan
key: konan-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }}
- name: Build shared framework
run: ./gradlew :shared:linkDebugFrameworkIosSimulatorArm64
- name: Cache ONNX Runtime xcframework
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: iosApp/Frameworks
key: onnxruntime-${{ hashFiles('iosApp/setup_onnxruntime.sh') }}
- name: Download ONNX Runtime
run: bash iosApp/setup_onnxruntime.sh
- name: Build iOS app
run: |
xcodebuild build \
-project iosApp/UkuleleCompanion.xcodeproj \
-scheme UkuleleCompanion \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
-configuration Debug \
CODE_SIGNING_ALLOWED=NO
- name: Run iOS tests
run: |
xcodebuild test \
-project iosApp/UkuleleCompanion.xcodeproj \
-scheme UkuleleCompanion \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
-configuration Debug \
CODE_SIGNING_ALLOWED=NO \
-enableCodeCoverage YES \
-resultBundlePath TestResults
- name: Build shared Release framework
run: ./gradlew :shared:linkReleaseFrameworkIosSimulatorArm64
- name: Build iOS app (Release)
run: |
xcodebuild build \
-project iosApp/UkuleleCompanion.xcodeproj \
-scheme UkuleleCompanion \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
-configuration Release \
ONLY_ACTIVE_ARCH=YES \
CODE_SIGNING_ALLOWED=NO
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ios-test-results
path: TestResults.xcresult
- name: Install xcresultparser
if: always()
run: |
curl -fsSL -o /tmp/xcresultparser.zip https://github.com/a7ex/xcresultparser/releases/download/2.0.1/xcresultparser.zip
echo "0af7cadc7d77431fab6fd15c3382ebcb35ea48881172aa780a43b757edfec1b7 /tmp/xcresultparser.zip" | shasum -a 256 -c -
unzip -o /tmp/xcresultparser.zip -d /tmp/xcresultparser
cp /tmp/xcresultparser/product/xcresultparser /usr/local/bin/xcresultparser
chmod +x /usr/local/bin/xcresultparser
- name: Convert xcresult to Cobertura XML
if: always()
run: xcresultparser --output-format cobertura TestResults.xcresult > coverage.xml
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: coverage.xml
flags: ios-tests
token: ${{ secrets.CODECOV_TOKEN }}