# Unit tests + smoke build. Runs on every push to master and on tags.
# Pure Go, no docker, so we use ubuntu/noble with a manual Go install
# (matches the style of tarantool-protobuf .builds, which is the
# primary downstream consumer of this binary).
image: ubuntu/noble
packages:
- curl
- ca-certificates
sources:
- https://git.srht.bigb.es/~bigbes/ci-cacher
environment:
GO_VERSION: "1.26.3"
PATH: /home/build/.local/go/bin:/home/build/.local/bin:/usr/local/bin:/usr/bin:/bin
submitter:
git.sr.ht:
enabled: true
allow-refs:
- refs/heads/master
- "refs/tags/*"
tasks:
- install_go: |
GO_TARBALL="go${GO_VERSION}.linux-amd64.tar.gz"
mkdir -p ~/.local
curl -sSL "https://go.dev/dl/$GO_TARBALL" -o "/tmp/$GO_TARBALL"
tar -xz -C ~/.local -f "/tmp/$GO_TARBALL"
rm "/tmp/$GO_TARBALL"
go version
- test: |
cd ci-cacher
go test ./...
- build: |
cd ci-cacher
go build -ldflags "-X go.bigb.es/cacher/internal/version.version=$(cat VERSION)" -o cacher .
./cacher version