From ce1e3f56407c0a2b01323f1f6c7bc3413446e1db Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sun, 7 Apr 2024 07:09:45 -0500 Subject: [PATCH] test: iOS apps installing Wendy via cocoapods can install and compile successfully To verify that Wendy can install and compile successfully using cocoapods, compile an example iOS app. commit-id:89139893 --- .github/workflows/tests.yml | 15 +++++++++---- app/.gitignore | 3 ++- app/Taskfile.yml | 43 +++++++++++++++++++++++++++++++------ app/ios/Podfile | 6 ++++++ app/ios/Taskfile.yml | 4 ++++ app/ios/project-spm.yml | 11 ++++++++++ app/ios/project.yml | 6 ------ 7 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 app/ios/Podfile create mode 100644 app/ios/Taskfile.yml create mode 100644 app/ios/project-spm.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf13e11..4a88f48 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 \ No newline at end of file + - name: Compile ${{ matrix.os }} app, using package manager ${{ matrix.package-manager }} + working-directory: app/${{ matrix.os }} + run: task app:build_${{ matrix.package-manager }} + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore index fec1810..f349ffa 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,2 @@ -*.xcodeproj/ \ No newline at end of file +*.xcodeproj/ +*.xcworkspace/ \ No newline at end of file diff --git a/app/Taskfile.yml b/app/Taskfile.yml index f496516..332552d 100644 --- a/app/Taskfile.yml +++ b/app/Taskfile.yml @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/app/ios/Podfile b/app/ios/Podfile new file mode 100644 index 0000000..c04b11f --- /dev/null +++ b/app/ios/Podfile @@ -0,0 +1,6 @@ + +target :App do + use_frameworks! + + pod 'Wendy', :git => 'https://github.com/levibostian/Wendy-iOS.git', :branch => 'latest' +end \ No newline at end of file diff --git a/app/ios/Taskfile.yml b/app/ios/Taskfile.yml new file mode 100644 index 0000000..cfb4ca2 --- /dev/null +++ b/app/ios/Taskfile.yml @@ -0,0 +1,4 @@ +version: 3 + +includes: + app: ../ \ No newline at end of file diff --git a/app/ios/project-spm.yml b/app/ios/project-spm.yml new file mode 100644 index 0000000..5ef1601 --- /dev/null +++ b/app/ios/project-spm.yml @@ -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 \ No newline at end of file diff --git a/app/ios/project.yml b/app/ios/project.yml index 4b2f2cf..77b30a0 100644 --- a/app/ios/project.yml +++ b/app/ios/project.yml @@ -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 \ No newline at end of file