-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (51 loc) · 1.62 KB
/
Copy pathci.yml
File metadata and controls
66 lines (51 loc) · 1.62 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
name: CI
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Set up environment file
run: make env
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Verify go fmt
run: |
diff=$(gofmt -s -l .)
if [ -n "$diff" ]; then
echo "The following files need formatting. Run: go fmt ./..."
echo "$diff"
exit 1
fi
- name: Build apps and tools
run: |
go build -o /dev/null ./apps/...
go build -o /dev/null ./tools/...
go build -o /dev/null ./infrastructure/cron/...
go build -o /dev/null ./infrastructure/clickhouse/migrate/...
go build -o /dev/null ./infrastructure/postgres/migrate/...
- name: Start Docker services
run: make infra
- name: Wait for services to be ready
run: |
sleep 10
docker compose ps
- name: Wait for databases to be ready
run: |
timeout 60 bash -c 'until docker compose exec -T postgres pg_isready -U dev; do sleep 1; done'
timeout 60 bash -c 'until docker compose exec -T clickhouse clickhouse-client --query "SELECT 1"; do sleep 1; done'
- name: Run migrations
run: make migrate
- name: Seed database
run: make seed
- name: Stop Docker services
if: always()
run: make down