Skip to content

Commit 988aa60

Browse files
committed
add libgit2 setup for go test
1 parent b684bfb commit 988aa60

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,42 @@ name: Gitconvex build deploy
33
on: push
44

55
jobs:
6+
libgit2-setup-test:
7+
name: Setup Libgit2 with Homebrew
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Install libssh2 and libgit2
11+
run: |
12+
brew install libssh2
13+
brew install libgit2
14+
615
gitconvex-test:
7-
name: Gitconvex test
16+
name: Gitconvex server test
817
runs-on: ubuntu-latest
18+
env:
19+
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.0/lib/pkgconfig/
20+
921
steps:
22+
- name: Install libgit2 from Homebrew
23+
run: |
24+
brew install libssh2
25+
brew install libgit2
26+
1027
- name: Set up Go 1.x
1128
uses: actions/setup-go@v2
1229
with:
1330
go-version: ^1.16
1431
id: go
15-
32+
1633
- name: Check out code into the Go module directory
1734
uses: actions/checkout@v2
1835

1936
- name: Run Go Test
2037
run: |
21-
go test -v ./...
38+
sudo cp /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.0/lib/lib* /usr/lib
39+
export PATH="/home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.0/lib/:$PATH"
40+
git config --global user.name "${{ secrets.ACTION_USER_NAME }}" && git config --global user.email "${{ secrets.ACTION_USER_EMAIL }}"
41+
export GOTESTENV=ci && go test -v ./...
2242
2343
# Build for Ubuntu Linux
2444
build-linux:
@@ -67,14 +87,14 @@ jobs:
6787
tar -czf gitconvex-linux-amd64-v${{ secrets.TARGET_RELEASE_CHANNEL }}.tar.gz *
6888
ls -ltr
6989
cd ..
70-
90+
7191
- name: Github CLI release for Linux
7292
run: |
7393
gh version
7494
echo ${{ secrets.CLI_AUTH_KEY }} > auth.txt
7595
gh auth login --with-token < auth.txt
76-
gh release upload --repo ${{ secrets.USER_NAME }}/gitconvex ${{ secrets.TARGET_RELEASE_CHANNEL }} ./dist/gitconvex-linux-amd64-v${{ secrets.TARGET_RELEASE_CHANNEL }}.tar.gz --clobber
77-
96+
gh release upload --repo ${{ secrets.USER_NAME }}/gitconvex ${{ secrets.TARGET_RELEASE_CHANNEL }} ./dist/gitconvex-linux-amd64-v${{ secrets.TARGET_RELEASE_CHANNEL }}.tar.gz --clobber
97+
7898
# Build for MacOS
7999
build-macos:
80100
needs: gitconvex-test
@@ -121,7 +141,7 @@ jobs:
121141
steps:
122142
- name: Check out code into the Go module directory
123143
uses: actions/checkout@v2
124-
144+
125145
- name: Add choco packages
126146
run: |
127147
choco install wget
@@ -155,17 +175,17 @@ jobs:
155175
rm C:\\Strawberry\\perl\\bin\\pkg-config.bat
156176
export PATH="/c/msys64/:/c/msys64/usr/:/c/msys64/usr/bin:$PATH"
157177
go get -v ./...
158-
./make.bat build
178+
./make.bat build
159179
160-
- name: Archive ZIP bundle for windows
180+
- name: Archive ZIP bundle for windows
161181
run: |
162182
cd dist
163183
cp -rp ../etc .
164184
7z a -r -tzip gitconvex-windows-v${{ secrets.TARGET_RELEASE_CHANNEL }}.zip *
165185
ls -ltr
166-
186+
167187
- name: Github CLI Release for windows
168188
run: |
169189
echo ${{ secrets.CLI_AUTH_KEY }} > auth.txt
170190
gh auth login --with-token < auth.txt
171-
gh release upload ${{ secrets.TARGET_RELEASE_CHANNEL }} ./dist/gitconvex-windows-v${{ secrets.TARGET_RELEASE_CHANNEL }}.zip --clobber
191+
gh release upload ${{ secrets.TARGET_RELEASE_CHANNEL }} ./dist/gitconvex-windows-v${{ secrets.TARGET_RELEASE_CHANNEL }}.zip --clobber

0 commit comments

Comments
 (0)