summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2021-09-17 15:08:38 +0200
committerAndrej Mihajlov <and@mullvad.net>2021-09-20 12:58:43 +0200
commit353beab2f92562db8e036e02f11cb21fee7a1600 (patch)
tree7fb0e9bd98f2dfd38216df8703b0a56b8f450b21
parentf064579b539ac10656de0f9b9c69912e4eb49cd4 (diff)
downloadmullvadvpn-353beab2f92562db8e036e02f11cb21fee7a1600.tar.xz
mullvadvpn-353beab2f92562db8e036e02f11cb21fee7a1600.zip
Actions: cache spm
-rw-r--r--.github/workflows/ios.yml19
-rw-r--r--ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved2
-rwxr-xr-xios/build-wireguard-go.sh22
3 files changed, 31 insertions, 12 deletions
diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml
index 4a055735c8..43c8f7bd7d 100644
--- a/.github/workflows/ios.yml
+++ b/.github/workflows/ios.yml
@@ -13,10 +13,20 @@ jobs:
strategy:
matrix:
destination: ['platform=iOS Simulator,OS=12.4,name=iPhone 8']
+ env:
+ source_packages_dir: .spm
steps:
- name: Checkout repository
uses: actions/checkout@v2
+ - name: Configure cache
+ uses: actions/cache@v2
+ with:
+ path: ios/${{ env.source_packages_dir }}
+ key: ${{ runner.os }}-spm-${{ hashFiles('ios/**/Package.resolved') }}
+ restore-keys: |
+ ${{ runner.os }}-spm-
+
- name: Setup go-lang
uses: actions/setup-go@v2
with:
@@ -29,7 +39,14 @@ jobs:
- name: Build and test
run: |
- xcodebuild clean test -project MullvadVPN.xcodeproj -scheme MullvadVPNTests -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES
+ xcodebuild test -project MullvadVPN.xcodeproj \
+ -scheme MullvadVPNTests \
+ -destination "${destination}" \
+ -clonedSourcePackagesDirPath "${SOURCE_PACKAGES_PATH}" \
+ CODE_SIGN_IDENTITY="" \
+ CODE_SIGNING_REQUIRED=NO \
+ ONLY_ACTIVE_ARCH=YES
working-directory: ios
env:
destination: ${{ matrix.destination }}
+ SOURCE_PACKAGES_PATH: ${{ env.source_packages_dir }}
diff --git a/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 8008fae640..5865002810 100644
--- a/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -11,7 +11,7 @@
}
},
{
- "package": "wireguard-apple",
+ "package": "WireGuardKit",
"repositoryURL": "https://git.zx2c4.com/wireguard-apple",
"state": {
"branch": null,
diff --git a/ios/build-wireguard-go.sh b/ios/build-wireguard-go.sh
index 2132644165..11a3b9c728 100755
--- a/ios/build-wireguard-go.sh
+++ b/ios/build-wireguard-go.sh
@@ -11,22 +11,24 @@
# Passed by Xcode
ACTION=$1
-# When archiving, Xcode sets the action to "install"
-if [ "$ACTION" == "install" ]; then
- SOURCE_PACKAGES_PATH="$BUILD_DIR/../../../../../SourcePackages"
-else
- SOURCE_PACKAGES_PATH="$BUILD_DIR/../../SourcePackages"
+if [ "$SOURCE_PACKAGES_PATH" == "" ]; then
+ # When archiving, Xcode sets the action to "install"
+ if [ "$ACTION" == "install" ]; then
+ SOURCE_PACKAGES_PATH="$BUILD_DIR/../../../../../SourcePackages"
+ else
+ SOURCE_PACKAGES_PATH="$BUILD_DIR/../../SourcePackages"
+ fi
fi
# Resolve SourcesPackages path
-RESLVED_SOURCE_PACKAGES_PATH="$( cd "$SOURCE_PACKAGES_PATH" && pwd -P )"
-if [ "$RESLVED_SOURCE_PACKAGES_PATH" == "" ]; then
- echo "Failed to resolve the SourcePackages path: $SOURCE_PACKAGES_PATH"
- exit -1
+RESOLVED_SOURCE_PACKAGES_PATH="$( cd "$SOURCE_PACKAGES_PATH" && pwd -P )"
+if [ "$RESOLVED_SOURCE_PACKAGES_PATH" == "" ]; then
+ echo "Failed to resolve the SourcePackages path: $SOURCE_PACKAGES_PATH"
+ exit -1
fi
# Compile the path to the Makefile directory
-WIREGUARD_KIT_GO_PATH="$RESLVED_SOURCE_PACKAGES_PATH/checkouts/wireguard-apple/Sources/WireGuardKitGo"
+WIREGUARD_KIT_GO_PATH="$RESOLVED_SOURCE_PACKAGES_PATH/checkouts/wireguard-apple/Sources/WireGuardKitGo"
echo "WireGuardKitGo path resolved to $WIREGUARD_KIT_GO_PATH"
# Run make