summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml8
-rw-r--r--Makefile8
-rwxr-xr-xscript/build-libgit2.sh5
3 files changed, 14 insertions, 7 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 047cb4a..d326170 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -40,7 +40,7 @@ jobs:
- name: Test
env:
GOPATH: /home/runner/work/git2go
- run: make test-static
+ run: make TEST_ARGS=-test.v test-static
build-static:
strategy:
@@ -64,7 +64,7 @@ jobs:
git submodule update --init
make build-libgit2-static
- name: Test
- run: make test-static
+ run: make TEST_ARGS=-test.v test-static
build-dynamic:
strategy:
@@ -86,7 +86,7 @@ jobs:
git submodule update --init
make build-libgit2-dynamic
- name: Test
- run: make test-dynamic
+ run: make TEST_ARGS=-test.v test-dynamic
build-system-dynamic:
strategy:
@@ -110,7 +110,7 @@ jobs:
git submodule update --init
sudo env BUILD_LIBGIT_REF=v${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
- name: Test
- run: make test
+ run: make TEST_ARGS=-test.v test
build-system-static:
strategy:
diff --git a/Makefile b/Makefile
index 182c53e..84262f4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+TEST_ARGS ?= --count=1
+
default: test
# System library
@@ -5,7 +7,7 @@ default: test
# This uses whatever version of libgit2 can be found in the system.
test:
go run script/check-MakeGitError-thread-lock.go
- go test --count=1 ./...
+ go test $(TEST_ARGS) ./...
install:
go install ./...
@@ -28,7 +30,7 @@ test-dynamic: dynamic-build/install/lib/libgit2.so
go run script/check-MakeGitError-thread-lock.go
PKG_CONFIG_PATH=dynamic-build/install/lib/pkgconfig \
LD_LIBRARY_PATH=dynamic-build/install/lib \
- go test --count=1 ./...
+ go test $(TEST_ARGS) ./...
install-dynamic: dynamic-build/install/lib/libgit2.so
PKG_CONFIG_PATH=dynamic-build/install/lib/pkgconfig \
@@ -47,7 +49,7 @@ static-build/install/lib/libgit2.a:
test-static: static-build/install/lib/libgit2.a
go run script/check-MakeGitError-thread-lock.go
- go test --count=1 --tags "static" ./...
+ go test --tags "static" $(TEST_ARGS) ./...
install-static: static-build/install/lib/libgit2.a
go install --tags "static" ./...
diff --git a/script/build-libgit2.sh b/script/build-libgit2.sh
index 5c420cd..e9c6c9c 100755
--- a/script/build-libgit2.sh
+++ b/script/build-libgit2.sh
@@ -71,4 +71,9 @@ cmake -DTHREADSAFE=ON \
-DDEPRECATE_HARD=ON \
"${VENDORED_PATH}" &&
+if which gmake nproc >/dev/null && [ -f Makefile ]; then
+ # Make the build parallel if gmake is available and cmake used Makefiles.
+ exec gmake "-j$(nproc --all)" install
+fi
+
exec cmake --build . --target install