-
Notifications
You must be signed in to change notification settings - Fork 17
178 lines (158 loc) · 4.75 KB
/
Copy pathtest.migration.clients.yaml
File metadata and controls
178 lines (158 loc) · 4.75 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
name: Test - Migration (Clients)
on:
pull_request:
paths:
- .github/actions/test-python/**
- .github/actions/test-typescript/**
- .github/workflows/test.migration.clients.yaml
- alamos/go/**
- alamos/py/**
- arc/go/**
- aspen/**
- cesium/**
- client/py/**
- client/ts/**
- core/**
- freighter/go/**
- freighter/py/**
- freighter/ts/**
- package.json
- pnpm-lock.yaml
- pyproject.toml
- uv.lock
- uv.toml
- x/go/**
- x/ts/**
push:
branches:
- main
- rc
paths:
- .github/actions/test-python/**
- .github/actions/test-typescript/**
- .github/workflows/test.migration.clients.yaml
- alamos/go/**
- alamos/py/**
- arc/go/**
- aspen/**
- cesium/**
- client/py/**
- client/ts/**
- core/**
- freighter/go/**
- freighter/py/**
- freighter/ts/**
- package.json
- pnpm-lock.yaml
- pyproject.toml
- uv.lock
- uv.toml
- x/go/**
- x/ts/**
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
permissions:
packages: write
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Start Core on main
id: start_main
run:
docker run -d --name synnax-main -p 9090:9090 -e SYNNAX_LISTEN=0.0.0.0:9090 -e
SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e
SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }}
ghcr.io/synnaxlabs/synnax:latest
- name: Wait for Core on main
run: |
for i in $(seq 1 30); do
nc -z localhost 9090 && exit 0
sleep 1
done
echo "Synnax failed to start" && exit 1
- name: Checkout main
uses: actions/checkout@v6
with:
ref: main
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: client/py/pyproject.toml
- name: Test Python with Core on main
run: uv run pytest
working-directory: client/py
- name: Test TypeScript with Core on main
uses: ./.github/actions/test-typescript
with:
package: client
lint: false
- name: Stop Core on main
if: always() && steps.start_main.outcome == 'success'
run: |
docker logs synnax-main
docker stop synnax-main
docker rm synnax-main
- name: Checkout current branch
uses: actions/checkout@v6
- name: Login to Github Container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Extract Go version
id: go-version
run:
echo "GO_VERSION=$(grep '^go ' core/go.mod | awk '{print $2}')" >>
$GITHUB_OUTPUT
- name: Build and push Core on current
uses: docker/build-push-action@v7
with:
context: .
file: core/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/synnaxlabs/synnax:${{ github.sha }}
cache-from: type=gha,scope=synnax-docker-cache
cache-to: type=inline
build-args: GO_VERSION=${{ steps.go-version.outputs.GO_VERSION }}
- name: Start Core on current branch
id: start_current
run:
docker run -d --name synnax-current -p 9090:9090 -e SYNNAX_LISTEN=0.0.0.0:9090
-e SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e
SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }}
ghcr.io/synnaxlabs/synnax:${{ github.sha }}
- name: Wait for Core on current branch
run: |
for i in $(seq 1 30); do
nc -z localhost 9090 && exit 0
sleep 1
done
echo "Synnax failed to start" && exit 1
- name: Test Python with Core on current branch
uses: ./.github/actions/test-python
with:
directory: client/py
type_check: false
format_check: false
- name: Test TypeScript with Core on current branch
uses: ./.github/actions/test-typescript
with:
package: client
lint: false
- name: Stop Core on current branch
if: always() && steps.start_current.outcome == 'success'
run: |
docker logs synnax-current
docker stop synnax-current
docker rm synnax-current