Skip to content

Commit

Permalink
test: iOS apps installing Wendy via cocoapods can install and compile…
Browse files Browse the repository at this point in the history
… successfully

To verify that Wendy can install and compile successfully using cocoapods, compile an example iOS app.

commit-id:89139893
  • Loading branch information
levibostian committed Apr 7, 2024
1 parent 72cbebc commit ce1e3f5
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 17 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: true

compile-apps:
runs-on: macos-13
runs-on: macos-13
strategy:
fail-fast: false # if one build fails, dont stop trying to finish the other.
matrix:
os: ["ios"]
package-manager: ["cocoapods", "spm"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-ios
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Compile iOS app
working-directory: app/ios
run: task build
- name: Compile ${{ matrix.os }} app, using package manager ${{ matrix.package-manager }}
working-directory: app/${{ matrix.os }}
run: task app:build_${{ matrix.package-manager }}


3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.xcodeproj/
*.xcodeproj/
*.xcworkspace/
43 changes: 37 additions & 6 deletions app/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,44 @@
version: '3'

tasks:
xcodegen_clean:
internal: true
cmds:
- rm -rf *.xcodeproj
- rm -rf *.xcworkspace

generate_xcode_project:
dir: '{{.USER_WORKING_DIR}}'
internal: true # meant to be called by one of the child tasks
cmds:
- mint run --mintfile ../../Mintfile xcodegen generate
- task: xcodegen_clean
- mint run --mintfile ../../Mintfile xcodegen generate --spec {{.XCODE_GEN_SPEC_FILENAME}}

build: # meant to be called in a subdirectory in app/ such as app/ios/
dir: '{{.USER_WORKING_DIR}}'
cmds:
generate_xcode_project_spm:
cmds:
- task: generate_xcode_project
vars:
XCODE_GEN_SPEC_FILENAME: project-spm.yml

generate_xcode_project_cocoapods:
cmds:
- task: generate_xcode_project
- set -o pipefail && xcrun xcodebuild clean build -scheme App | xcbeautify
vars:
XCODE_GEN_SPEC_FILENAME: project.yml
- pod install

build:
internal: true # meant to be called by one of the child tasks
cmds:
- set -o pipefail && xcrun xcodebuild clean build {{.XCODEBUILD_ARGS}} -scheme App | xcbeautify

build_spm: # meant to be called in a subdirectory in app/ such as app/ios/
cmds:
- task: generate_xcode_project_spm
- task: build

build_cocoapods: # meant to be called in a subdirectory in app/ such as app/ios/
cmds:
- task: generate_xcode_project_cocoapods
- task: build
vars:
XCODEBUILD_ARGS: -workspace App.xcworkspace
6 changes: 6 additions & 0 deletions app/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

target :App do
use_frameworks!

pod 'Wendy', :git => 'https://github.com/levibostian/Wendy-iOS.git', :branch => 'latest'
end
4 changes: 4 additions & 0 deletions app/ios/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 3

includes:
app: ../
11 changes: 11 additions & 0 deletions app/ios/project-spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include:
- project.yml

packages:
Wendy:
url: https://github.com/levibostian/Wendy-iOS.git
branch: latest # To verify that the latest changes are always compilable. Dont lock to a specific version.
targets:
App:
dependencies:
- package: Wendy
6 changes: 0 additions & 6 deletions app/ios/project.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: App
options:
bundleIdPrefix: earth.levi.wendy
packages:
Wendy:
url: https://github.com/levibostian/Wendy-iOS.git
branch: latest # To verify that the latest changes are always compilable. Dont lock to a specific version.
targets:
App:
type: application
platform: iOS
deploymentTarget: "17.0"
sources: Source
dependencies:
- package: Wendy
settings:
GENERATE_INFOPLIST_FILE: YES
CODE_SIGNING_ALLOWED: NO

0 comments on commit ce1e3f5

Please sign in to comment.