generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 21
251 lines (207 loc) · 6.46 KB
/
build-pull-request.yml
File metadata and controls
251 lines (207 loc) · 6.46 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
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
name: Build Pull Request
on: [pull_request]
permissions:
contents: read
jobs:
java-client:
name: Build Java Client
runs-on: ubuntu-latest
defaults:
run:
working-directory: hft_client/java_client
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'corretto'
java-version: '11'
cache: 'maven'
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Run tests
run: mvn test
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: java-client-jar
path: hft_client/java_client/target/*.jar
retention-days: 7
rust-server:
name: Build Rust Mock Trading Server
runs-on: ubuntu-latest
defaults:
run:
working-directory: mock-trading-server
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Check formatting
run: cargo fmt --check
continue-on-error: true
- name: Run Clippy
run: cargo clippy -- -D warnings
continue-on-error: true
- name: Build
run: cargo build --release
- name: Run tests
run: cargo test
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: rust-server-binary
path: mock-trading-server/target/release/mock-trading-server
retention-days: 7
rust-client:
name: Build Rust HFT Client
runs-on: ubuntu-latest
defaults:
run:
working-directory: hft_client/rust_client
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Check formatting
run: cargo fmt --check
continue-on-error: true
- name: Run Clippy
run: cargo clippy -- -D warnings
continue-on-error: true
- name: Build
run: cargo build --release
- name: Run tests
run: cargo test
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: rust-client-binary
path: hft_client/rust_client/target/release/hft_client
retention-days: 7
cpp-client-linux:
name: Build C++ Client (Linux)
runs-on: ubuntu-latest
defaults:
run:
working-directory: hft_client/cpp-client
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libssl-dev libboost-all-dev zlib1g-dev
- name: Create build directory
run: mkdir -p build
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: cpp-client-linux-binary
path: hft_client/cpp-client/build/*
retention-days: 7
cpp-client-windows:
name: Build C++ Client (Windows)
runs-on: windows-latest
defaults:
run:
working-directory: hft_client/cpp-client
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git ../vcpkg
cd ../vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
- name: Install dependencies
run: |
cd ../vcpkg
.\vcpkg install openssl:x64-windows zlib:x64-windows
- name: Configure CMake
shell: bash
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build build --config Release
- name: Copy DLLs
shell: bash
run: |
cp ../vcpkg/installed/x64-windows/bin/libssl-3-x64.dll build/Release/
cp ../vcpkg/installed/x64-windows/bin/libcrypto-3-x64.dll build/Release/
cp "C:/Windows/System32/msvcp140.dll" build/Release/ || true
cp "C:/Windows/System32/vcruntime140.dll" build/Release/ || true
cp "C:/Windows/System32/vcruntime140_1.dll" build/Release/ || true
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: cpp-client-windows-binary
path: hft_client/cpp-client/build/Release/*.dll hft_client/cpp-client/build/Release/*.exe
retention-days: 7
cdk-infrastructure:
name: Build CDK Infrastructure
runs-on: ubuntu-latest
defaults:
run:
working-directory: deployment/cdk
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: deployment/cdk/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Run tests
run: npm test
continue-on-error: true
- name: Synthesize CDK
run: npx cdk synth
- name: Upload CDK template
uses: actions/upload-artifact@v4
with:
name: cdk-template
path: deployment/cdk/cdk.out
retention-days: 7
af-xdp-benchmark:
name: Build AF_XDP Benchmark
runs-on: ubuntu-latest
defaults:
run:
working-directory: af_xdp_zero_copy_perf_benchmark
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libbpf-dev libxdp-dev
continue-on-error: true
- name: Build AF_XDP components
run: make
continue-on-error: true