1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-21 21:47:32 +02:00

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>.
This commit is contained in:
Stefan Haller 2023-07-02 20:17:18 +02:00
parent adce8ad398
commit d71f5d951e

@ -47,13 +47,47 @@ jobs:
run: |
go test ./... -short
integration-tests:
strategy:
fail-fast: false
matrix:
git-version:
- 2.20.0 # oldest supported version
- 2.22.5
- 2.23.0
- 2.25.1
- 2.30.8
- latest # We rely on github to have the latest version installed on their VMs
runs-on: ubuntu-latest
name: "Integration Tests"
name: "Integration Tests - git ${{matrix.git-version}}"
env:
GOFLAGS: -mod=vendor
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Restore Git cache
if: matrix.git-version != 'latest'
id: cache-git-restore
uses: actions/cache/restore@v3
with:
path: ~/git-${{matrix.git-version}}
key: ${{runner.os}}-git-${{matrix.git-version}}
- name: Build Git ${{matrix.git-version}}
if: steps.cache-git-restore.outputs.cache-hit != 'true' && matrix.git-version != 'latest'
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
&& curl -sL "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${{matrix.git-version}}.tar.xz" -o - | tar xJ -C "$HOME"
&& cd "$HOME/git-${{matrix.git-version}}"
&& ./configure
&& make -j
- name: Install Git ${{matrix.git-version}}
if: matrix.git-version != 'latest'
run: sudo make -C "$HOME/git-${{matrix.git-version}}" -j install
- name: Save Git cache
if: steps.cache-git-restore.outputs.cache-hit != 'true' && matrix.git-version != 'latest'
uses: actions/cache/save@v3
with:
path: ~/git-${{matrix.git-version}}
key: ${{runner.os}}-git-${{matrix.git-version}}
- name: Setup Go
uses: actions/setup-go@v1
with:
@ -67,9 +101,11 @@ jobs:
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test
restore-keys: |
${{runner.os}}-go-
- name: Print git version
run: git --version
- name: Test code
run: |
go test pkg/integration/clients/*.go
./scripts/run_integration_tests.sh
build:
runs-on: ubuntu-latest
env: