Skip to content

Commit

Permalink
Merge pull request #3 from Picovoice/initial-ios
Browse files Browse the repository at this point in the history
Initial iOS
  • Loading branch information
ErisMik authored Apr 19, 2024
2 parents ab85201 + dda4158 commit 4a2f2ef
Show file tree
Hide file tree
Showing 82 changed files with 4,560 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: iOS Demos

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'demo/ios/**'
- '.github/workflows/ios-demos.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'demo/ios/**'
- '.github/workflows/ios-demos.yml'

defaults:
run:
working-directory: demo/ios/PicoLLMDemo

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Cocoapods
run: gem install cocoapods

- name: Run Cocoapods
run: pod install

- name: Build
run: xcrun xcodebuild build
-configuration Debug
-workspace PicoLLMDemo.xcworkspace
-sdk iphoneos
-scheme PicoLLMDemo
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO
55 changes: 55 additions & 0 deletions .github/workflows/ios-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: iOS Tests

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '.github/workflows/ios-local.yml'
- 'binding/ios/PicoLLMAppTest/**'
- 'resources/.test/**'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/ios-local.yml'
- 'binding/ios/PicoLLMAppTest/**'
- 'resources/.test/**'

defaults:
run:
working-directory: binding/ios/PicoLLMAppTest

jobs:
build:
name: Run iOS Tests
runs-on: pv-ios

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run Cocoapods
run: pod install

- name: Inject AccessKey
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
PicoLLMAppTestUITests/BaseTest.swift

- name: Inject Resource URL
run: sed -i '.bak' 's?{TESTING_MODEL_URL_HERE}?http://${{secrets.PV_CICD_RES_SERVER_AUTHORITY}}/github/picollm/res/phi2-290.bin/latest/phi2-290.bin?'
PicoLLMAppTestUITests/BaseTest.swift

- name: XCode Build
run: xcrun xcodebuild build-for-testing
-configuration Debug
-workspace PicoLLMAppTest.xcworkspace
-sdk iphoneos
-scheme PicoLLMAppTest
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO

- name: Run Tests on Simulator
run: xcrun xcodebuild test
-workspace PicoLLMAppTest.xcworkspace
-scheme PicoLLMAppTest
-destination 'platform=iOS Simulator,name=iPhone 13'
26 changes: 26 additions & 0 deletions .github/workflows/swift-codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Swift Codestyle

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '**/*.swift'
- '.github/workflows/swift-codestyle.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '**/*.swift'
- '.github/workflows/swift-codestyle.yml'

jobs:
check-switch-codestyle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Check swift codestyle
uses: norio-nomura/[email protected]
with:
args: lint --config resources/.lint/swift/.swiftlint.yml --strict
19 changes: 19 additions & 0 deletions binding/ios/PicoLLM-iOS.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Pod::Spec.new do |s|
s.name = 'PicoLLM-iOS'
s.module_name = 'PicoLLM'
s.version = '1.0.0'
s.license = {:type => 'Apache 2.0'}
s.summary = 'iOS SDK for PicoLLM'
s.description =
<<-DESC
PicoLLM engine.
DESC
s.homepage = 'https://github.com/Picovoice/picollm/tree/master/binding/ios'
s.author = { 'Picovoice' => '[email protected]' }
s.source = { :git => '' }
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvPicoLLM.xcframework'
s.source_files = '*.{swift}'
s.exclude_files = 'PicoLLMAppTest/**'
end
Loading

0 comments on commit 4a2f2ef

Please sign in to comment.