Repository navigation
86 lines (74 loc) · 1.94 KB
/
Copy pathci.yml
File metadata and controls
86 lines (74 loc) · 1.94 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
name: CI
on:
pull_request:
push:
branches: [develop]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
go:
name: Go
runs-on: ubuntu-latest
defaults:
run:
working-directory: api
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: walletops
POSTGRES_PASSWORD: walletops
POSTGRES_DB: walletops
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U walletops -d walletops"
--health-interval 2s
--health-timeout 5s
--health-retries 15
env:
DATABASE_URL: postgres://walletops:walletops@localhost:5432/walletops?sslmode=disable
JWT_SECRET: ci-jwt-secret
WEBHOOK_SECRET: dev-webhook-secret
AI_PROVIDER: mock
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: api/go.sum
- name: Test
run: go test ./...
flutter:
name: Flutter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.38.6"
channel: stable
cache: true
- name: Start API stack
run: docker compose up --build -d
- name: Wait for API health
run: |
for i in $(seq 1 60); do
if curl -fsS http://127.0.0.1:8080/v1/health >/dev/null; then
echo "API ready"
exit 0
fi
sleep 2
done
docker compose logs
exit 1
- name: Pub get
working-directory: mobile
run: flutter pub get
- name: Analyze
working-directory: mobile
run: flutter analyze
- name: Test
working-directory: mobile
run: flutter test --dart-define=API_BASE=http://127.0.0.1:8080