Skip to content

Commit 2078f63

Browse files
committed
Run integration tests with various git versions
We pick a few interesting ones in the range of supported versions. Based on work by Ryooooooga <eial5q265e5@gmail.com>.
1 parent 388d95c commit 2078f63

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,45 @@ jobs:
4747
run: |
4848
go test ./... -short
4949
integration-tests:
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
git-version:
54+
- 2.20.0 # oldest supported version
55+
- 2.22.5
56+
- 2.23.0
57+
- 2.25.1
58+
- 2.30.8
59+
- 2.41.0
5060
runs-on: ubuntu-latest
51-
name: "Integration Tests"
61+
name: "Integration Tests - git ${{matrix.git-version}}"
5262
env:
5363
GOFLAGS: -mod=vendor
5464
steps:
5565
- name: Checkout code
5666
uses: actions/checkout@v3
67+
- name: Restore Git cache
68+
id: cache-git-restore
69+
uses: actions/cache/restore@v3
70+
with:
71+
path: ~/git-${{matrix.git-version}}
72+
key: ${{runner.os}}-git-${{matrix.git-version}}
73+
- name: Install Git dependencies
74+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential ca-certificates curl gettext libexpat1-dev libssl-dev libz-dev openssl
75+
- name: Build Git ${{matrix.git-version}}
76+
if: steps.cache-git-restore.outputs.cache-hit != 'true'
77+
run: >
78+
curl -sL "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${{matrix.git-version}}.tar.xz" -o - | tar xJ -C "$HOME"
79+
&& cd "$HOME/git-${{matrix.git-version}}"
80+
&& ./configure
81+
&& make -j
82+
- name: Install Git ${{matrix.git-version}}
83+
run: sudo make -C "$HOME/git-${{matrix.git-version}}" -j install
84+
- name: Save Git cache
85+
uses: actions/cache/save@v3
86+
with:
87+
path: ~/git-${{matrix.git-version}}
88+
key: ${{runner.os}}-git-${{matrix.git-version}}
5789
- name: Setup Go
5890
uses: actions/setup-go@v1
5991
with:
@@ -70,7 +102,7 @@ jobs:
70102
- name: Test code
71103
# LONG_WAIT_BEFORE_FAIL means that for a given test assertion, we'll wait longer before failing
72104
run: |
73-
LONG_WAIT_BEFORE_FAIL=true go test pkg/integration/clients/*.go
105+
LONG_WAIT_BEFORE_FAIL=true ./scripts/run_integration_tests.sh
74106
build:
75107
runs-on: ubuntu-latest
76108
env:

0 commit comments

Comments
 (0)