ci: run the tests on the arch runner with git 2.45 or newer
- commit
- ea9bcf1dbea0952a32ec790d8b59c8f436e4cef6
- author
- brice · · 2026-10-10 22:26 UTC
- parent
- df84e16
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +17 -1
M .forgejo/workflows/ci.yml +15 -1
| @@ -26,13 +26,27 @@ jobs: | |||
| 26 | 26 | ||
| 27 | 27 | test: | |
| 28 | 28 | name: Test | |
| 29 | - | runs-on: ubuntu-latest | |
| 29 | + | # The conformance tests compare with git >= 2.45 (git 2.39 of ubuntu-latest | |
| 30 | + | # peels nested tags and writes Bloom filters differently). The arch label runs | |
| 31 | + | # archlinux:latest as root, with a current git. | |
| 32 | + | runs-on: arch | |
| 30 | 33 | steps: | |
| 34 | + | - name: System packages | |
| 35 | + | run: pacman -Syu --noconfirm --needed git gcc | |
| 31 | 36 | - uses: actions/checkout@v6 | |
| 32 | 37 | - uses: actions/setup-go@v5 | |
| 33 | 38 | with: | |
| 34 | 39 | go-version-file: go.mod | |
| 35 | 40 | cache: true | |
| 41 | + | - name: Git is at least 2.45 | |
| 42 | + | run: | | |
| 43 | + | git --version | |
| 44 | + | v=$(git --version | sed -E 's/^git version ([0-9]+)\.([0-9]+).*/\1 \2/') | |
| 45 | + | set -- $v | |
| 46 | + | if [ "$1" -lt 2 ] || { [ "$1" -eq 2 ] && [ "$2" -lt 45 ]; }; then | |
| 47 | + | echo "git 2.45 or newer is required" >&2 | |
| 48 | + | exit 1 | |
| 49 | + | fi | |
| 36 | 50 | - name: Verify tidy | |
| 37 | 51 | run: | | |
| 38 | 52 | go mod tidy | |
| @@ -26,13 +26,27 @@ jobs: | |||||
| 26 | 26 | ||||
| 27 | test: | 27 | test: | ||
| 28 | name: Test | 28 | name: Test | ||
| 29 | - | runs-on: ubuntu-latest | 29 | + | # The conformance tests compare with git >= 2.45 (git 2.39 of ubuntu-latest |
| 30 | + | # peels nested tags and writes Bloom filters differently). The arch label runs | |||
| 31 | + | # archlinux:latest as root, with a current git. | |||
| 32 | + | runs-on: arch | |||
| 30 | steps: | 33 | steps: | ||
| 34 | + | - name: System packages | |||
| 35 | + | run: pacman -Syu --noconfirm --needed git gcc | |||
| 31 | - uses: actions/checkout@v6 | 36 | - uses: actions/checkout@v6 | ||
| 32 | - uses: actions/setup-go@v5 | 37 | - uses: actions/setup-go@v5 | ||
| 33 | with: | 38 | with: | ||
| 34 | go-version-file: go.mod | 39 | go-version-file: go.mod | ||
| 35 | cache: true | 40 | cache: true | ||
| 41 | + | - name: Git is at least 2.45 | |||
| 42 | + | run: | | |||
| 43 | + | git --version | |||
| 44 | + | v=$(git --version | sed -E 's/^git version ([0-9]+)\.([0-9]+).*/\1 \2/') | |||
| 45 | + | set -- $v | |||
| 46 | + | if [ "$1" -lt 2 ] || { [ "$1" -eq 2 ] && [ "$2" -lt 45 ]; }; then | |||
| 47 | + | echo "git 2.45 or newer is required" >&2 | |||
| 48 | + | exit 1 | |||
| 49 | + | fi | |||
| 36 | - name: Verify tidy | 50 | - name: Verify tidy | ||
| 37 | run: | | 51 | run: | | ||
| 38 | go mod tidy | 52 | go mod tidy | ||
M README.md +2 -0
| @@ -49,6 +49,8 @@ Repositories the package does not read are rejected by `Open` with `ErrUnsupport | |||
| 49 | 49 | ||
| 50 | 50 | ## Test | |
| 51 | 51 | ||
| 52 | + | The conformance tests compare with the `git` binary, 2.45 or newer (they are skipped without git). | |
| 53 | + | ||
| 52 | 54 | ```sh | |
| 53 | 55 | go test -race ./... | |
| 54 | 56 | # also compare every object of a real repository with `git cat-file`: | |
| @@ -49,6 +49,8 @@ Repositories the package does not read are rejected by `Open` with `ErrUnsupport | |||||
| 49 | 49 | ||||
| 50 | ## Test | 50 | ## Test | ||
| 51 | 51 | ||||
| 52 | + | The conformance tests compare with the `git` binary, 2.45 or newer (they are skipped without git). | |||
| 53 | + | ||||
| 52 | ```sh | 54 | ```sh | ||
| 53 | go test -race ./... | 55 | go test -race ./... | ||
| 54 | # also compare every object of a real repository with `git cat-file`: | 56 | # also compare every object of a real repository with `git cat-file`: | ||