-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathbase.yml
More file actions
227 lines (217 loc) · 8.12 KB
/
base.yml
File metadata and controls
227 lines (217 loc) · 8.12 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
version: 2.1
commands:
custom-checkout:
description: "Shallow checkout code"
parameters:
submodules:
type: boolean
default: false
steps:
- run:
name: Shallow checkout code
command: |
if [ -z "$CIRCLE_BRANCH" ] || [ -n "$CIRCLE_TAG" ]; then echo "TODO: handle no-branch or tag-triggered CI"; exit 1; fi
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
' > ~/.ssh/known_hosts
cat $CHECKOUT_KEY > ~/.ssh/id_rsa
if [[ "$CIRCLE_BRANCH" =~ ^pull\/* ]]; then
clone_branch=main
else
clone_branch="$CIRCLE_BRANCH"
fi
clone_args=(--depth=1 --branch "$clone_branch")
if << parameters.submodules >>; then clone_args+=(--shallow-submodules --recurse-submodules); fi
git clone "${clone_args[@]}" "$CIRCLE_REPOSITORY_URL" .
if [[ "$CIRCLE_BRANCH" =~ ^pull\/* ]]; then
git fetch --force origin "$CIRCLE_BRANCH/head:remotes/origin/$CIRCLE_BRANCH"
fi
git checkout "$CIRCLE_SHA1" -B "$CIRCLE_BRANCH"
jobs:
fast-checks:
docker:
- image: skiplabs/skip:latest
resource_class: small
steps:
- custom-checkout
- run:
name: Check code is formatted
command: |
make check-fmt
- run:
name: Check shell scripts
command: |
make check-sh
check-ts:
docker:
- image: skiplabs/skip:latest
steps:
- custom-checkout:
submodules: true
- run:
name: Install pnpm
command: npm install -g pnpm
- run:
name: Typecheck and lint typescript sources
command: SKIPRUNTIME=$(pwd)/build/skipruntime pnpm install && pnpm run build && pnpm run lint
compiler:
docker:
- image: skiplabs/skiplang:latest
resource_class: xlarge
steps:
- custom-checkout:
submodules: true
- run:
name: Run compiler tests
no_output_timeout: 30m
command: |
mkdir -p ~/test-results
cd skiplang/compiler && make STAGE=1
PATH=$(realpath ./stage1/bin):$PATH skargo test --jobs 8 --junitxml ~/test-results/skc.xml
- store_test_results:
path: ~/test-results/skc.xml
skdb:
docker:
- image: skiplabs/skdb-base:latest
steps:
- custom-checkout:
submodules: true
- run:
name: Run native skdb tests
command: |
make test-native
skdb-wasm:
docker:
- image: skiplabs/skdb-base:latest
steps:
- custom-checkout:
submodules: true
- run:
name: Install pnpm
command: npm install -g pnpm
- run:
name: Run wasm skdb tests
no_output_timeout: 15m
command: |
mkdir -p ~/test-results
make test-wasm
- store_test_results:
path: ~/test-results/skdb-wasm.xml
skip-package-build:
docker:
- image: skiplabs/skiplang:latest
resource_class: medium
parameters:
dir:
type: string
steps:
- custom-checkout:
submodules: true
- run:
name: Build << parameters.dir >>
command: |
cd << parameters.dir >> && skargo build --all-targets
skip-package-tests:
docker:
- image: skiplabs/skiplang:latest
resource_class: medium
parameters:
dir:
type: string
steps:
- custom-checkout:
submodules: true
- run:
name: Run << parameters.dir >> tests
command: |
mkdir -p ~/test-results
cd << parameters.dir >> && skargo test --jobs 2 --junitxml ~/test-results/$(tr / - \<<< "<< parameters.dir >>").xml
- store_test_results:
path: ~/test-results
skipruntime:
docker:
- image: skiplabs/skip:latest
- image: cimg/postgres:17.0
environment:
PGHOST: localhost
PGDATABASE: postgres
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: secret
- image: bitnami/kafka
command: sh -c "((sleep 15 && /opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --create --topic skip-test-topic)&) && /opt/bitnami/scripts/kafka/run.sh"
environment:
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093"
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@localhost:9093"
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
steps:
- custom-checkout:
submodules: true
- run:
name: Install pnpm
command: npm install -g pnpm
- run:
name: Run wasm skip runtime tests
no_output_timeout: 10m
command: |
mkdir -p ~/test-results
make test-skipruntime-ts
- store_test_results:
path: ~/test-results/skipruntime.xml
check-examples:
docker:
- image: cimg/base:2025.01
steps:
- custom-checkout:
submodules: true
- setup_remote_docker
- run:
name: Build hackernews docker images
working_directory: ~/project/examples/hackernews
command: docker compose build
- run:
name: Start hackernews services
working_directory: ~/project/examples/hackernews
command: docker compose up --wait
- run:
name: Test hackernews back end health
command: (docker run --network hackernews_default -it cimg/base:2025.01 curl --silent --max-time 0.1 --insecure --location https://haproxy/api/posts || true) | grep --quiet "data:"
- run:
name: Tear down hackernews example
working_directory: ~/project/examples/hackernews
command: docker compose down
- run:
name: Build chatroom docker images
working_directory: ~/project/examples/chatroom
command: docker compose build
- run:
name: Start chatroom services
working_directory: ~/project/examples/chatroom
command: docker compose up --wait
- run:
name: Test chatroom back end health
command: (docker run --network chatroom_default -it cimg/base:2025.01 curl --silent --max-time 0.1 --insecure --location https://haproxy/api/messages || true) | grep --quiet "data:"
- run:
name: Tear down chatroom example
working_directory: ~/project/examples/chatroom
command: docker compose down
- run:
name: Build blogger docker images
working_directory: ~/project/examples/blogger
command: docker compose build
- run:
name: Start blogger services
working_directory: ~/project/examples/blogger
command: docker compose up --wait
- run:
name: Test blogger back end health
command: (docker run --network blogger_default -it cimg/base:2025.01 curl --silent --max-time 5 --insecure --location https://blogger_haproxy/api/posts || true) | grep --quiet "event:"
- run:
name: Tear down blogger example
working_directory: ~/project/examples/blogger
command: docker compose down