diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-10 15:13:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 15:13:43 +0200 |
commit | 5ba1eb278560f54071b731394ecd00b4cc99d4f3 (patch) | |
tree | 12fe095660ec6b566a60011c728989ff412b0435 /.github | |
parent | 057742d4af3c8e6f632663e8ca286b75c768492c (diff) | |
parent | d71f5d951eb7bb69cd894750347002bed8416998 (diff) |
Run integration tests with all supported git versions (#2754)
Run integration tests with various different git versions, more or less
randomly picked from our range of supported versions. Based on
@Ryooooooga's work in #2459, but also restructured a bit.
All tests pass for all git versions, but only after cherry-picking
#2747.
I decided to go with @Ryooooooga's approach and do it without using
docker. I also didn't use docker locally; to reproduce the various
failures that I had to fix, I simply installed the respective git
versions locally and used something like
`PATH=~/git-versions/2.25.1/bin:$PATH
./scripts/run_integration_tests.sh`.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/cd.yml | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 50 | ||||
-rw-r--r-- | .github/workflows/sponsors.yml | 2 |
3 files changed, 45 insertions, 9 deletions
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 49fad7731..398fd1ede 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Unshallow repo run: git fetch --prune --unshallow - name: Setup Go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3494e6a40..9326ca103 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: GOFLAGS: -mod=vendor steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v1 with: @@ -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@v2 + 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: @@ -77,7 +113,7 @@ jobs: GOARCH: amd64 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v1 with: @@ -113,7 +149,7 @@ jobs: GOARCH: amd64 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v1 with: @@ -147,7 +183,7 @@ jobs: GOFLAGS: -mod=vendor steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v1 with: diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml index e4c780445..cdf328a73 100644 --- a/.github/workflows/sponsors.yml +++ b/.github/workflows/sponsors.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate Sponsors 💖 uses: JamesIves/github-sponsors-readme-action@v1.0.8 |