-
Notifications
You must be signed in to change notification settings - Fork 893
65 lines (53 loc) · 1.77 KB
/
git.yml
File metadata and controls
65 lines (53 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Git Compatibility
on:
workflow_dispatch:
push:
branches:
- releases/v5.x
- main
pull_request:
permissions: {}
jobs:
test:
strategy:
fail-fast: false
matrix:
git: [[master, ubuntu-latest], [v2.11.0, ubuntu-latest]]
runs-on: ${{ matrix.git[1] }}
env:
GIT_VERSION: ${{ matrix.git[0] }}
GIT_DIST_PATH: .git-dist/${{ matrix.git[0] }}
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: stable
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install gettext libcurl4-openssl-dev
- name: Git Build
run: make build-git
- name: Set Git config environment variables
run: |
echo "GIT_DIST_PATH=.git-dist/${{ matrix.git[0] }}" >> $GITHUB_ENV
echo "GIT_EXEC_PATH=${{ github.workspace }}/$GIT_DIST_PATH" >> $GITHUB_ENV
echo "PATH=${{ github.workspace }}/$GIT_DIST_PATH:$PATH" >> $GITHUB_ENV
- name: Verify Git installation
run: |
exec_path=$(git --exec-path)
echo "Git exec path: $exec_path"
if [ "$exec_path" != "${{ github.workspace }}/.git-dist/${{ matrix.git[0] }}" ]; then
echo "Git exec path mismatch: expected ${{ github.workspace }}/.git-dist/${{ matrix.git[0] }}, got $exec_path"
exit 1
fi
git config --global user.email "gha@example.com"
git config --global user.name "GitHub Actions"
- name: Test
run: make test-coverage
- name: Build go-git with CGO disabled
run: go build ./...
env:
CGO_ENABLED: 0