Skip to content

Commit 8b95a2b

Browse files
authored
Use branch head commit SHA for package manager checks (#248)
1 parent a4b7720 commit 8b95a2b

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

.github/workflows/checks.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: macos-latest
1717
env:
1818
scheme: ${{ 'Readium-Package' }}
19-
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
19+
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
2020

2121
steps:
2222
- name: Checkout
@@ -73,13 +73,8 @@ jobs:
7373
run: |
7474
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"
7575
76-
# The following integration jobs are run only when pushing to `develop` or `main`.
77-
# As they use a specific commit hash, they can't run properly from a pull request
78-
# opened from forks.
79-
8076
int-spm:
8177
name: Integration (Swift Package Manager)
82-
if: github.event_name == 'push'
8378
runs-on: macos-latest
8479
defaults:
8580
run:
@@ -88,6 +83,12 @@ jobs:
8883
steps:
8984
- name: Checkout
9085
uses: actions/checkout@v2
86+
# We can't use the current github.sha with pull_request event, because they will
87+
# reference the merge commit which cannot be fetched with SPM.
88+
- name: Set commit SHA
89+
if: github.event_name == 'pull_request'
90+
run: |
91+
echo "commit_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
9192
- name: Install dependencies
9293
run: brew install xcodegen
9394
- name: Generate project
@@ -98,7 +99,6 @@ jobs:
9899
99100
int-carthage:
100101
name: Integration (Carthage)
101-
if: github.event_name == 'push'
102102
runs-on: macos-latest
103103
defaults:
104104
run:
@@ -107,6 +107,12 @@ jobs:
107107
steps:
108108
- name: Checkout
109109
uses: actions/checkout@v2
110+
# We can't use the current github.sha with pull_request event, because they will
111+
# reference the merge commit which cannot be fetched with Carthage.
112+
- name: Set commit SHA
113+
if: github.event_name == 'pull_request'
114+
run: |
115+
echo "commit_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
110116
- name: Install dependencies
111117
run: brew install xcodegen
112118
- name: Generate project

Cartfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github "cezheng/Fuzi" ~> 3.1.3
22
github "dexman/Minizip" ~> 1.4.0
3-
github "krzyzanowskim/CryptoSwift" ~> 1.3.8
3+
github "krzyzanowskim/CryptoSwift" == 1.5.1 # From 1.6.0, the build fails in GitHub actions
44
github "ra1028/DifferenceKit" ~> 1.3.0
55
github "readium/GCDWebServer" ~> 3.7.3
66
github "scinfu/SwiftSoup" ~> 2.4.3

Package.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ let package = Package(
2020
],
2121
dependencies: [
2222
.package(url: "https://github.com/cezheng/Fuzi.git", from: "3.1.3"),
23-
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.3.8"),
23+
// From 1.6.0, the build fails in GitHub actions with Carthage
24+
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", "1.5.1"..<"1.6.0"),
2425
.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"),
2526
.package(url: "https://github.com/ra1028/DifferenceKit.git", from: "1.3.0"),
2627
.package(url: "https://github.com/readium/GCDWebServer.git", from: "3.7.3"),

Support/CocoaPods/ReadiumLCP.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Pod::Spec.new do |s|
2323

2424
s.dependency 'ZIPFoundation', '<= 0.9.11' # 0.9.12 requires iOS 12+
2525
s.dependency 'SQLite.swift', '~> 0.13'
26-
s.dependency 'CryptoSwift', '~> 1.3.8'
26+
s.dependency 'CryptoSwift', '<= 1.5.1' # From 1.6.0, the build fails in GitHub actions with Carthage
2727
end

Support/CocoaPods/ReadiumStreamer.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
2121
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
2222

2323
s.dependency 'R2Shared'
24-
s.dependency 'CryptoSwift', '~> 1.3.8'
24+
s.dependency 'CryptoSwift', '<= 1.5.1' # From 1.6.0, the build fails in GitHub actions
2525
s.dependency 'Fuzi', '~> 3.0'
2626
s.dependency 'GCDWebServer', '~> 3.0'
2727
s.dependency 'Minizip', '~> 1.0'

TestApp/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ifdef lcp
5858
else
5959
@cp Integrations/Carthage/project.yml .
6060
endif
61-
carthage update --verbose --platform ios --use-xcframeworks --cache-builds
61+
carthage update --verbose --platform ios --use-xcframeworks --cache-builds --no-use-binaries
6262
xcodegen generate
6363
@echo "\nopen TestApp.xcodeproj"
6464

0 commit comments

Comments
 (0)