Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/BuildPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,18 @@ jobs:
- name: Unlink openssl 3
run: |
brew unlink openssl@3
# - name: Test project
# run: make test ARCH=${{ matrix.abi }}
- name: Test project
id: run-unit-tests
run: |
make test \
ARCH=${{ matrix.abi }} \
RESULT_BUNDLE=UnitTestResults-${{ matrix.abi }}.xcresult
- name: Upload unit test results
if: ${{ failure() && steps.run-unit-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v7
with:
name: UnitTestResults-${{ matrix.abi }}.xcresult
path: UnitTestResults-${{ matrix.abi }}.xcresult
retention-days: ${{ github.event_name == 'pull_request' && 7 || 90 }}
- name: Archive project
run: make archive ARCH=${{ matrix.abi }}
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ DESTINATION := platform=macOS,arch=$(ARCH)
LIBGIT2_ARCHIVE := External/libgit2.a
LIBGIT2_BUILD_DIR := External/libgit2/build

# Set to a path to have xcodebuild write an .xcresult bundle, which is where CI
# reads failed unit test results back out of a test run.
RESULT_BUNDLE ?=
RESULT_BUNDLE_ARG := $(if $(RESULT_BUNDLE),-resultBundlePath $(RESULT_BUNDLE))

XCODEBUILD := xcodebuild -workspace $(WORKSPACE) -scheme "$(SCHEME)" ARCHS="$(ARCH)"

MAKEFILE := $(firstword $(MAKEFILE_LIST))
Expand Down Expand Up @@ -101,7 +106,7 @@ build: git-submodule-check ## Build the macOS framework
$(XCODEBUILD) -destination "$(DESTINATION)" build

test: git-submodule-check ## Run the macOS framework specs
$(XCODEBUILD) -destination "$(DESTINATION)" test
$(XCODEBUILD) -destination "$(DESTINATION)" $(RESULT_BUNDLE_ARG) test

archive: git-submodule-check ## Build a release archive of the macOS framework
$(XCODEBUILD) archive
Expand Down
6 changes: 6 additions & 0 deletions ObjectiveGitFramework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,12 @@
"$(inherited)",
"-DGIT_SSH",
);
// Override the vendored Carthage/Checkouts/xcconfigs Debug.xcconfig,
// which hardcodes "--digest-algorithm=sha1". Current codesign
// rejects SHA-1 outright ("signing with only SHA1 not allowed"),
// so drop it here and keep only the network-independent timestamp
// opt-out.
OTHER_CODE_SIGN_FLAGS = "--timestamp=none";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WARNING_CFLAGS = (
Expand Down
10 changes: 9 additions & 1 deletion ObjectiveGitTests/GTSubmoduleSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,15 @@

__block NSError *error = nil;
expect(@([submodule sync:&error])).to(beTruthy());
expect([config stringForKey:configKey]).to(equal(@"../Test_App"));

// The fixture repository has no "origin" remote configured, so
// libgit2 resolves the submodule's relative URL ("../Test_App")
// against the parent repository's working directory instead of a
// remote URL, producing an absolute path to the sibling Test_App
// fixture rather than leaving the URL as the relative string.
NSString *expectedURL = [repo.fileURL URLByDeletingLastPathComponent].path;
expectedURL = [expectedURL stringByAppendingPathComponent:@"Test_App"];
expect([config stringForKey:configKey]).to(equal(expectedURL));
});
});

Expand Down
1 change: 1 addition & 0 deletions script/update_libgit2
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ cmake --version
cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTS:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
-DUSE_SSH=libssh2 \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
..
cmake --build .
Expand Down
Loading