forked from minekube/gate
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (120 loc) · 4.02 KB
/
Copy pathci.yml
File metadata and controls
138 lines (120 loc) · 4.02 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: ci
on:
push:
workflow_dispatch:
pull_request:
types: [opened, reopened]
env:
REGISTRY: ghcr.io
permissions: {}
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
- name: golangci-lint
run: golangci-lint run --timeout 3m0s
test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Go with cache
uses: actions/setup-go@v6
with:
cache: true
go-version-file: go.mod
- name: Test
run: make test
- name: Smoke test - Geyserlite Windows auto-download starts
if: matrix.platform == 'windows-latest'
run: go test ./pkg/edition/bedrock/geyser -tags=geyserlite_smoke -run TestLiteManagedRunnerWindowsAutoDownloadSmoke -count=1 -timeout 6m -v
# Regression test for https://github.com/minekube/gate/issues/697:
# The published images crashed with "exec /gate: no such file or directory"
# because the gate binary is dynamically linked (the geyserlite dependency
# pulls in github.com/ebitengine/purego, which imports libdl.so.2 via
# //go:cgo_import_dynamic even with CGO_ENABLED=0) but the runtime base image
# had no glibc dynamic loader. This job builds the actual images and runs the
# binary and starts managed Bedrock on both architectures so broken runtime
# dependencies or cache paths fail CI instead of shipping.
docker-smoke:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.runner }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up docker buildx
uses: docker/setup-buildx-action@v4
- name: Build gate image (host arch, load)
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
load: true
target: gate
build-args: |
VERSION=smoke-test
tags: gate:smoke
- name: Smoke test - gate binary execs in distroless image
run: |
out="$(docker run --rm gate:smoke --version)"
echo "$out"
echo "$out" | grep -q "gate version smoke-test"
- name: Smoke test - managed Bedrock starts in read-only distroless image
run: |
cid=$(docker run -d --read-only --tmpfs /tmp \
-v "$PWD/.github/testdata/managed-bedrock.yml:/config.yml:ro" \
gate:smoke --config /config.yml)
trap 'docker logs "$cid" 2>&1 || true; docker rm -f "$cid" >/dev/null 2>&1 || true' EXIT
for _ in $(seq 1 180); do
logs=$(docker logs "$cid" 2>&1)
if grep -q "geyser integration started" <<<"$logs"; then
exit 0
fi
if [ "$(docker inspect -f '{{.State.Running}}' "$cid")" != "true" ]; then
exit 1
fi
sleep 1
done
exit 1
- name: Build jre variant image (host arch, load)
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
load: true
target: jre
build-args: |
VERSION=smoke-test
tags: gate-jre:smoke
- name: Smoke test - gate binary execs in jre image
run: |
out="$(docker run --rm gate-jre:smoke --version)"
echo "$out"
echo "$out" | grep -q "gate version smoke-test"