Repository navigation
251 lines (216 loc) · 7.56 KB
/
Copy pathci.yml
File metadata and controls
251 lines (216 loc) · 7.56 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Check and Test
on:
pull_request:
push:
branches:
- master
# Twice a month, so a new toolchain or a dependency's release shows up while nothing is pushed.
schedule:
- cron: "22 4 1,16 * *"
workflow_dispatch:
jobs:
build:
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-26.04, macos-26, windows-2025]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install-unix
if: ${{ runner.os != 'Windows' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: install-windows
if: ${{ runner.os == 'Windows' }}
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: post install
run: |
moon version --all
moon update
- name: moon check
run: moon check --target all --deny-warn
- name: moon build
run: moon build --target all
- name: moon test (all backends)
run: moon test --target all
- name: examples run
if: runner.os == 'Linux'
run: |
for dir in src/examples/*/; do
if grep -q 'kind: "executable"' "$dir/moon.pkg" && ! grep -q 'supported_targets = "js"' "$dir/moon.pkg"; then
moon run "$dir" --target native > /dev/null
fi
done
- name: lint (fmt is clean)
run: |
moon fmt && git diff --exit-code
# A reader pastes the blocks of the README and the skills into a project, so they
# have to compile as written, against this commit's source.
- name: the code in the docs compiles
if: runner.os == 'Linux'
run: python3 scripts/check_snippets.py
# The site is generated from the sources, so a page that no longer matches
# them is a stale page: regenerate and fail on any difference.
- name: site is up to date
if: runner.os == 'Linux'
run: |
python3 scripts/gen_site.py
git diff --exit-code docs
# The pages are generated from the files the section table names, so a
# declaration in a file no page reads is exported and undocumented while every
# other check stays green. This compares the interface files against the pages.
- name: the API reference covers every public item
if: runner.os == 'Linux'
run: python3 scripts/check_api_pages.py
- name: interfaces are up to date
run: |
moon info --target all && git diff --exit-code
- name: the skills are valid
if: runner.os == 'Linux'
run: |
for dir in docs/skills/*/; do
case "$dir" in *CHANGE-ME*) continue ;; esac
[ -f "$dir/SKILL.md" ] || continue
pipx run --spec skills-ref agentskills validate "$dir"
done
# Two directions over a real socket, with a peer that shares no code with this
# library: a gRPC client written against the Go implementation calls this
# library's server, and this library's client calls that peer's server. A green
# run means the frames on the wire are the ones a gRPC peer expects.
interop:
name: zRPC interoperability (native, go peer)
runs-on: ubuntu-26.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install moonbit
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: post install
run: |
moon version --all
moon update
- uses: actions/setup-go@v5
with:
go-version-file: scripts/interop/go.mod
cache: false
- name: both directions
run: bash scripts/interop/check.sh
# The path from registration to a load-balanced call against each real service, and the
# shared limiters against redis, gated on MOON_REDIS_TEST and its siblings.
discovery:
name: discovery drivers (native, live redis)
runs-on: ubuntu-26.04
permissions:
contents: read
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: post install
run: |
moon version --all
moon update
- name: discovery round trip against live redis
env:
MOON_REDIS_TEST: "1"
MOON_REDIS_HOST: "127.0.0.1"
run: moon test --target native
# consul's agent needs `agent -dev` arguments, so it is started with docker run
# rather than a service container.
discovery-consul:
name: discovery drivers (native, live consul)
runs-on: ubuntu-26.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: post install
run: |
moon version --all
moon update
- name: start consul (dev agent)
run: |
docker run -d --name consul -p 8500:8500 hashicorp/consul:1.20 agent -dev -client 0.0.0.0
- name: wait for consul
run: |
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8500/v1/status/leader | grep -qE '[0-9]'; then
echo "consul is up"; break
fi
echo "waiting for consul... ($i)"; sleep 2
done
curl -sf http://127.0.0.1:8500/v1/agent/self | head -c 200
- name: discovery round trip against live consul
env:
MOON_CONSUL_TEST: "1"
MOON_CONSUL_HOST: "127.0.0.1"
run: moon test --target native
discovery-etcd:
name: discovery drivers (native, live etcd)
runs-on: ubuntu-26.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: post install
run: |
moon version --all
moon update
- name: start etcd
run: |
docker run -d --name etcd -p 2379:2379 quay.io/coreos/etcd:v3.5.16 \
/usr/local/bin/etcd --name node1 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-client-urls http://0.0.0.0:2379
- name: wait for etcd
run: |
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:2379/health | grep -q '"health":"true"'; then
echo "etcd is up"; break
fi
echo "waiting for etcd... ($i)"; sleep 2
done
curl -sf http://127.0.0.1:2379/health
- name: discovery round trip against live etcd
env:
MOON_ETCD_TEST: "1"
MOON_ETCD_HOST: "127.0.0.1"
run: moon test --target native