Skip to content

Commit

Permalink
Multiplatform target (#140)
Browse files Browse the repository at this point in the history
* 🔧 Create single multiplatform target in Xcode project

* 🔥 Remove unavailable code

* 🔧 Create multiplatform test target

* 🔥 Get rid of Cocoapods

* 🔧 Use SPM project structure

* 🔧 Use separate test target for tests that require responder chain

* 🔧 Make compilable for watchOS and tvOS

* 👷 Add CI job

* 🔧 Move checks workflow to PR workflow

* 📝 Update changelog
  • Loading branch information
olejnjak authored Nov 20, 2023
1 parent cc68023 commit 99b74ba
Show file tree
Hide file tree
Showing 106 changed files with 971 additions and 2,181 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname
name: Build

on: [pull_request, push, workflow_dispatch]
on: [workflow_call]

jobs:
carthage:
Expand All @@ -12,4 +11,23 @@ jobs:
- uses: AckeeCZ/[email protected]
- name: Build
run: carthage build --no-skip-current --cache-builds --use-xcframeworks

- uses: actions/cache@v3
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
spm:
name: SPM
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: Build
run: swift build -c release
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
12 changes: 0 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,3 @@ jobs:
file: ACKategories.xcframework.zip
tags: true
draft: false
cocoapods:
name: Push podspec to Cocoapods trunk
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: Install gems
run: bundle install
- name: Push podspec
run: bundle exec pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
17 changes: 5 additions & 12 deletions .github/workflows/checks.yml → .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname
name: Checks
name: PR

on: [pull_request]

jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml
swiftlint:
name: Swiftlint
runs-on: ubuntu-latest
Expand All @@ -22,13 +24,4 @@ jobs:
with:
changelog_regex: 'CHANGELOG.md'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
podspec:
name: Podspec
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install Bundler dependencies
run: bundle install
- name: Lint podspec
run: bundle exec pod lib lint --allow-warnings
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 39 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
name: Tests

on: [pull_request, push]
on: [workflow_call]

jobs:
tests:
name: Run tests
xcodebuild:
name: Xcodebuild
runs-on: macos-13
env:
IOS_DEVICE: iPhone 15 Pro Max
steps:
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: Run iOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -resultBundlePath Tests-iOS.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 15 Pro Max,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty
- name: iOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategories -resultBundlePath Tests-iOS.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Tests-iOS.xcresult
path: Tests-iOS.xcresult
- name: Run macOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategoriesCore -resultBundlePath Tests-macOS.xcresult -destination 'platform=OS X,arch=x86_64' | xcpretty
- name: iOS responder tests
run: set -o pipefail && xcodebuild test -scheme ACKategories -resultBundlePath Tests-iOS-Responder.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Tests-iOS-Responder.xcresult
path: Tests-iOS-Responder.xcresult
- name: macOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategories -resultBundlePath Tests-macOS.xcresult -destination 'platform=OS X,arch=x86_64' | xcpretty
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Tests-macOS.xcresult
path: Tests-macOS.xcresult
path: Tests-macOS.xcresult
- name: watchOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategories -resultBundlePath Tests-watchOS.xcresult -sdk watchsimulator -destination "platform=watchOS Simulator,name=Apple Watch Ultra 2 (49mm),OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Tests-watchOS.xcresult
path: Tests-watchOS.xcresult
- name: tvOS tests
run: set -o pipefail && xcodebuild test -scheme ACKategories -resultBundlePath Tests-tvOS.xcresult -sdk appletvsimulator -destination "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Tests-tvOS.xcresult
path: Tests-tvOS.xcresult
spm:
name: SPM
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: SPM tests
run: swift test
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
*.xcodeproj/**/xcuserdata/
*.xcscmblueprint
Carthage/Build
Carthage/Checkouts
Carthage
/.build
.DS_Store
DerivedData
.swiftpm/
# Tapestry
Tapestries/.build
Tapestries/.swiftpm
.swiftpm/
5 changes: 2 additions & 3 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ whitelist_rules:
- weak_delegate
- overridden_super_call
included: # paths to include during linting. `--path` is ignored if present.
- ACKategoriesCore
- ACKategories-iOS
- ACKategories
- ACKategoriesTests
- ACKategoriesExample
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
force_cast: warning # implicitly
function_body_length:
- 100 # warning
Expand Down
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

19 changes: 0 additions & 19 deletions ACKategories-iOS/Aliases.swift

This file was deleted.

18 changes: 0 additions & 18 deletions ACKategories-iOS/Supporting files/ACKategories_iOS.h

This file was deleted.

22 changes: 0 additions & 22 deletions ACKategories-iOS/Supporting files/Info.plist

This file was deleted.

45 changes: 0 additions & 45 deletions ACKategories-iOS/TableHeaderFooterView.swift

This file was deleted.

39 changes: 0 additions & 39 deletions ACKategories-iOS/UIView+SafeAreaCompat.swift

This file was deleted.

31 changes: 0 additions & 31 deletions ACKategories-iOS/UIViewController+SafeAreaCompat.swift

This file was deleted.

22 changes: 0 additions & 22 deletions ACKategories-iOSTests/Info.plist

This file was deleted.

Loading

0 comments on commit 99b74ba

Please sign in to comment.