-
Notifications
You must be signed in to change notification settings - Fork 59
257 lines (209 loc) · 6.98 KB
/
main.yml
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: CI
# Controls when the action will run. Triggers the workflow on push
# or pull request events, but only for the primary branch.
on:
push:
branches: [master]
paths-ignore:
- 'site/**'
pull_request:
branches: [master]
paths-ignore:
- 'site/**'
env:
CARGO_TERM_COLOR: always
CARGO_CACHE_VERSION: 0.8.2
RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
gnu-binaries:
runs-on: ubuntu-2404-large
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
lfs: true
- uses: actions/setup-go@v2
with:
go-version: "1.21"
- uses: dtolnay/rust-toolchain@stable
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Google Cloud Auth
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase start
- name: SQL tests
run: ./supabase/run_sql_tests.sh
- run: make extra-ci-runner-setup
- run: make print-versions
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "2404"
- name: Cache/Restore Go dependencies.
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- run: make install-tools
- run: go mod download
- run: make rust-gnu-test
- run: make linux-gnu-binaries
- name: Ensure that we didn't dirty the tree.
run: git clean --force -d && git diff --exit-code || exit 1
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: linux-gnu-binaries
path: |
.build/package/bin/*
target/x86_64-unknown-linux-gnu/release/libbindings.a
crates/bindings/flow_bindings.h
target/x86_64-unknown-linux-gnu/release/librocksdb-exp/
musl-binaries:
runs-on: ubuntu-2404-large
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make extra-ci-runner-setup
- run: make print-versions
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "2404"
- run: go mod download
- run: make rust-musl-test
- run: make linux-musl-binaries
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: linux-musl-binaries
path: |
.build/package/bin/*
assembly:
runs-on: ubuntu-2404-large
needs: [gnu-binaries, musl-binaries]
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: flow
POSTGRES_USER: flow
POSTGRES_PASSWORD: flow
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v2
with:
go-version: "1.23"
- name: Cache/Restore Go dependencies.
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- run: make extra-ci-runner-setup
- run: make print-versions
- name: Google Cloud Auth
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Login to GitHub container registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | \
docker login --username ${{ github.actor }} --password-stdin ghcr.io
- name: Download gnu-linux-binaries
uses: actions/download-artifact@v4
with:
name: linux-gnu-binaries
path: linux-gnu-binaries
- name: Move linux-gnu-binaries to PKGBIN
run: |
mkdir -p .build/package/bin && \
mv linux-gnu-binaries/.build/package/bin/* .build/package/bin && \
mkdir -p target/x86_64-unknown-linux-gnu/release && \
mv -f linux-gnu-binaries/target/x86_64-unknown-linux-gnu/release/* target/x86_64-unknown-linux-gnu/release/ && \
mv -f linux-gnu-binaries/crates/bindings/flow_bindings.h crates/bindings/
- name: Download linux-musl-binaries
uses: actions/download-artifact@v4
with:
name: linux-musl-binaries
path: linux-musl-binaries
- name: Move linux-musl-binaries to PKGBIN
run: |
mkdir -p .build/package/bin && \
mv linux-musl-binaries/* .build/package/bin
# Downloaded artifacts lose their prior permission settings
- name: Adjust binaries permissions
run: |
chmod +x .build/package/bin/*
- name: Add PKGDIR/bin to PATH
run: echo "$GITHUB_WORKSPACE/.build/package/bin" >> $GITHUB_PATH
- name: make catalog-test
run: |
make catalog-test SKIP_BUILD=true
- name: make go-test-ci
run: |
make go-test-ci SKIP_BUILD=true
- name: make end-to-end-test
run: |
make end-to-end-test SKIP_BUILD=true
- name: make package (tar only)
run: |
make /home/runner/work/flow/flow/.build/package/flow-x86-linux.tar.gz
- name: Ensure that we didn't dirty the tree.
run: git clean --force -d && git diff --exit-code || exit 1
- run: make docker-image
- run: make docker-push
- if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-dev
- if: ${{ github.ref == 'refs/heads/master' }}
name: Upload release assets
uses: softprops/action-gh-release@v1
with:
body: |
This is the latest development build, which gets updated on every successful build of the master branch.
target_commitish: ${{ github.sha }}
draft: false
prerelease: true
tag_name: dev
generate_release_notes: false
files: .build/package/flow-x86-linux.tar.gz