File tree Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 9191 build-system-dynamic :
9292 strategy :
9393 fail-fast : false
94+ matrix :
95+ libgit2 : [ '1.1.0' ]
9496 name : Go (system-wide, dynamic)
9597
9698 runs-on : ubuntu-20.04
@@ -103,10 +105,10 @@ jobs:
103105 id : go
104106 - name : Check out code into the Go module directory
105107 uses : actions/checkout@v1
106- - name : Build libgit2
108+ - name : Build libgit2 ${{ matrix.libgit2 }}
107109 run : |
108110 git submodule update --init
109- sudo ./script/build-libgit2.sh --dynamic --system
111+ sudo env BUILD_LIBGIT_REF=v${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
110112 - name : Test
111113 run : make test
112114
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ package git
99#cgo CFLAGS: -DLIBGIT2_STATIC
1010#include <git2.h>
1111
12- #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
13- # error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
12+ #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
13+ # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0 "
1414#endif
1515*/
1616import "C"
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ package git
77#cgo CFLAGS: -DLIBGIT2_DYNAMIC
88#include <git2.h>
99
10- #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
11- # error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
10+ #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
11+ # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0 "
1212#endif
1313*/
1414import "C"
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ package git
77#cgo CFLAGS: -DLIBGIT2_STATIC
88#include <git2.h>
99
10- #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
11- # error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
10+ #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
11+ # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0 "
1212#endif
1313*/
1414import "C"
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ if [ -z "${BUILD_SHARED_LIBS}" ]; then
4646 usage
4747fi
4848
49+ if [ -n " ${BUILD_LIBGIT_REF} " ]; then
50+ git -C " ${VENDORED_PATH} " checkout " ${BUILD_LIBGIT_REF} "
51+ trap " git submodule update --init" EXIT
52+ fi
53+
4954if [ " ${BUILD_SYSTEM} " = " ON" ]; then
5055 BUILD_INSTALL_PREFIX=${SYSTEM_INSTALL_PREFIX-" /usr" }
5156else
You can’t perform that action at this time.
0 commit comments