| 1 |
on: [push, pull_request] |
| 2 |
name: Git Compatibility |
| 3 |
permissions: |
| 4 |
contents: read |
| 5 |
|
| 6 |
jobs: |
| 7 |
test: |
| 8 |
strategy: |
| 9 |
fail-fast: false |
| 10 |
matrix: |
| 11 |
git: [[master, ubuntu-latest], [v2.11.0, ubuntu-latest]] |
| 12 |
|
| 13 |
runs-on: ${{ matrix.git[1] }} |
| 14 |
env: |
| 15 |
GIT_VERSION: ${{ matrix.git[0] }} |
| 16 |
GIT_DIST_PATH: .git-dist/${{ matrix.git[0] }} |
| 17 |
|
| 18 |
steps: |
| 19 |
- name: Checkout code |
| 20 |
uses: actions/checkout@v4 |
| 21 |
|
| 22 |
- name: Install Go |
| 23 |
uses: actions/setup-go@v5 |
| 24 |
with: |
| 25 |
go-version: stable |
| 26 |
|
| 27 |
- name: Install build dependencies |
| 28 |
run: sudo apt-get update && sudo apt-get install gettext libcurl4-openssl-dev |
| 29 |
|
| 30 |
- name: Git Build |
| 31 |
run: make build-git |
| 32 |
|
| 33 |
- name: Set Git config |
| 34 |
run: | |
| 35 |
export GIT_DIST_PATH=.git-dist/${{ matrix.git[0] }} |
| 36 |
export GIT_EXEC_PATH=${{ github.workspace }}/$GIT_DIST_PATH |
| 37 |
export PATH=$GIT_EXEC_PATH:$PATH |
| 38 |
git --exec-path |
| 39 |
git config --global user.email "[email protected]" |
| 40 |
git config --global user.name "GitHub Actions" |
| 41 |
|
| 42 |
- name: Test |
| 43 |
run: make test-coverage |
| 44 |
|
| 45 |
- name: Test SHA256 |
| 46 |
run: make test-sha256 |
| 47 |
|
| 48 |
- name: Build go-git with CGO disabled |
| 49 |
run: go build ./... |
| 50 |
env: |
| 51 |
CGO_ENABLED: 0 |