-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.72 KB
/
ci.yml
File metadata and controls
71 lines (60 loc) · 1.72 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start ClickHouse
run: |
docker compose up -d clickhouse
echo "Waiting for ClickHouse to be ready..."
for i in $(seq 1 60); do
if curl -sSf http://localhost:8123/ >/dev/null 2>&1; then
echo "ClickHouse is ready"
exit 0
fi
sleep 2
done
echo "ClickHouse did not become ready in time"
exit 1
- name: Setup Erlang/OTP and Gleam
uses: erlef/setup-beam@v1
with:
otp-version: "27.0"
gleam-version: "1.13.0"
- name: Show Gleam version
run: gleam --version
- name: Cache Gleam deps and build
uses: actions/cache@v4
with:
path: |
~/.cache/gleam
~/.gleam
./_gleam_deps
./build
key: ${{ runner.os }}-gleam-1.13.0-otp27-cache-v1-${{ hashFiles('**/gleam.toml') }}
restore-keys: |
${{ runner.os }}-gleam-1.13.0-otp27-cache-v1-
- name: Install dependencies
run: gleam deps download
- name: Check formatting
run: gleam format --check src test
- name: Build project
run: gleam build
- name: Run all tests
env:
CLICKHOUSE_USER: test_user
CLICKHOUSE_PASSWORD: test_password
CLICKHOUSE_DB: test_db
CLICKHOUSE_URL: http://localhost:8123
run: gleam test
- name: Cleanup ClickHouse
if: always()
run: docker compose down -v