Skip to content

Commit

Permalink
Update CI to modern xcode and fix Carthage (#47)
Browse files Browse the repository at this point in the history
* Update CI to modern xcode and fix Carthage

* Match makefile and CI

* Since Cocoapods has issues with 14 let's use 13 for now

* I think I fixed it?

* Target iPhone 13 so we can use Xcode 13
  • Loading branch information
garrettmoon authored Nov 28, 2022
1 parent ea79ebf commit 13eddaf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,53 @@ on:
jobs:
test:
name: Test
runs-on: macOS-latest
runs-on: macos-latest
strategy:
matrix:
platform: ['iOS Simulator,name=iPhone 8']
platform: ['iOS Simulator,name=iPhone 13']
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Test
run: make test
analyze:
name: Analyze
runs-on: macOS-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: analyze
run: make analyze
cocoapods:
name: CocoaPods
runs-on: macOS-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Cocoapods lint
run: make cocoapods
carthage:
name: Carthage
runs-on: macOS-latest
env:
# Carthage is broken in Xcode 12 and above https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: carthage
run: make carthage
swift-package-manager:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Verify that PINCache can be build by SPM
run: make spm
5 changes: 4 additions & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
required: true
jobs:
create_release:
runs-on: macOS-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
# Make sure we can lint before creating the release.
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Cocoapods lint
run: make cocoapods
- name: Create Release Commit
Expand Down
21 changes: 10 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
PLATFORM="platform=iOS Simulator,name=iPhone 8"
PLATFORM="platform=iOS Simulator,name=iPhone 13"
SDK="iphonesimulator"
SHELL=/bin/bash -o pipefail
XCODE_MAJOR_VERSION=$(shell xcodebuild -version | HEAD -n 1 | sed -E 's/Xcode ([0-9]+).*/\1/')

.PHONY: all cocoapods test analyze carthage spm
.PHONY: all cocoapods test analyze carthage spm install_xcbeautify

carthage:
if [ ${XCODE_MAJOR_VERSION} -gt 11 ] ; then \
echo "Carthage no longer works in Xcode 12 https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md"; \
exit 1; \
fi
carthage build --no-skip-current
carthage build --no-skip-current --use-xcframeworks

cocoapods:
pod lib lint

analyze:
install_xcbeautify:
if ! command -v xcbeautify &> /dev/null; then brew install xcbeautify; fi

analyze: install_xcbeautify
xcodebuild clean analyze -destination ${PLATFORM} -sdk ${SDK} -project PINOperation.xcodeproj -scheme PINOperation \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_REQUIRED=NO \
CLANG_ANALYZER_OUTPUT=plist-html \
CLANG_ANALYZER_OUTPUT_DIR="$(shell pwd)/clang" | xcpretty
CLANG_ANALYZER_OUTPUT_DIR="$(shell pwd)/clang" | xcbeautify
if [[ -n `find $(shell pwd)/clang -name "*.html"` ]] ; then rm -rf `pwd`/clang; exit 1; fi
rm -rf $(shell pwd)/clang

test:
test: install_xcbeautify
xcodebuild clean test -destination ${PLATFORM} -sdk ${SDK} -project PINOperation.xcodeproj -scheme PINOperation \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_REQUIRED=NO | xcpretty
CODE_SIGNING_REQUIRED=NO | xcbeautify

spm:
# For now just check whether we can assemble it
Expand Down

0 comments on commit 13eddaf

Please sign in to comment.