1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
image: ubuntu/noble
packages:
- curl
- ca-certificates
- gnupg
- protobuf-compiler
- cmake
- build-essential
- docker.io
- awscli
- zstd
secrets:
- a42011da-a362-40da-9db6-1bf1f9be8be3 # ~/.s3-cache-key-id
- c0cf5f2d-5d63-4d50-a324-5eaecaa992dd # ~/.s3-cache-key-secret
sources:
- https://git.srht.bigb.es/~bigbes/tarantool-protobuf
environment:
GOPATH: /home/build/go
GOROOT: /home/build/.local/go
GO_VERSION: "1.26.3"
PATH: /home/build/.local/go/bin:/home/build/.local/bin:/home/build/go/bin:/usr/local/bin:/usr/bin:/bin
AWS_DEFAULT_REGION: garage
AWS_ENDPOINT_URL: https://s3.bigb.es
S3_BUCKET: docker-cache
S3_PREFIX: tarantool-protobuf/conformance-images
submitter:
git.sr.ht:
enabled: true
allow-refs:
- refs/heads/master
- "refs/tags/*"
tasks:
- aws_credentials: |
mkdir -p ~/.aws
cat > ~/.aws/config <<EOF
[default]
region = $AWS_DEFAULT_REGION
s3 =
addressing_style = path
signature_version = s3v4
EOF
set +x
export AWS_ACCESS_KEY_ID=$(cat ~/.s3-cache-key-id)
export AWS_SECRET_ACCESS_KEY=$(cat ~/.s3-cache-key-secret)
{
printf 'export AWS_ACCESS_KEY_ID=%q\n' "$AWS_ACCESS_KEY_ID"
printf 'export AWS_SECRET_ACCESS_KEY=%q\n' "$AWS_SECRET_ACCESS_KEY"
} >> ~/.buildenv
set -x
aws --endpoint-url="$AWS_ENDPOINT_URL" s3 ls "s3://$S3_BUCKET/" >/dev/null
- install_go: |
mkdir -p ~/.local
curl -sSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xz -C ~/.local
go version
- install_tarantool: |
curl -L https://tarantool.io/release/3/installer.sh | sudo bash
sudo apt-get install -y tarantool tarantool-dev tt
- install_just: |
mkdir -p ~/.local/bin
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh \
| bash -s -- --to ~/.local/bin
- install_luatest: |
cd tarantool-protobuf
tt rocks install luatest
- docker_start: |
sudo systemctl start docker
sudo usermod -aG docker build
sudo chmod 666 /var/run/docker.sock
docker version
- conformance_image: |
cd tarantool-protobuf
HASH=$(sha256sum docker/conformance.Dockerfile | cut -c1-16)
OBJECT_KEY="$S3_PREFIX/$HASH.tar.zst"
S3_URI="s3://$S3_BUCKET/$OBJECT_KEY"
echo "Image hash: $HASH"
echo "S3 URI: $S3_URI"
if aws --endpoint-url="$AWS_ENDPOINT_URL" s3api head-object \
--bucket "$S3_BUCKET" --key "$OBJECT_KEY" >/dev/null 2>&1; then
echo "Cache HIT — pulling cached image"
aws --endpoint-url="$AWS_ENDPOINT_URL" s3 cp "$S3_URI" - \
| unzstd \
| docker load
else
echo "Cache MISS — building from scratch and uploading"
docker build -t tarantool-protobuf-conformance:latest \
-f docker/conformance.Dockerfile docker/
docker save tarantool-protobuf-conformance:latest \
| zstd -T0 -3 \
| aws --endpoint-url="$AWS_ENDPOINT_URL" s3 cp - "$S3_URI"
fi
docker image inspect tarantool-protobuf-conformance:latest >/dev/null
- codegen: |
cd tarantool-protobuf
just gen
- conformance: |
cd tarantool-protobuf
docker run --rm -v "$(pwd):/work" -w /work \
tarantool-protobuf-conformance:latest
- conformance_c: |
cd tarantool-protobuf
docker run --rm -v "$(pwd):/work" -w /work -e PB_ENABLE_C=1 \
--entrypoint bash tarantool-protobuf-conformance:latest -c '
set -e
make -C runtime/pb/c clean >/dev/null
make -C runtime/pb/c >/dev/null
conformance_test_runner --enforce_recommended \
--failure_list test/conformance/known_failures.txt \
--text_format_failure_list test/conformance/known_failures_text.txt \
/usr/bin/tarantool cmd/conformance-runner.lua
rc=$?
make -C runtime/pb/c clean >/dev/null
exit $rc
'