-
Notifications
You must be signed in to change notification settings - Fork 23
69 lines (57 loc) · 1.96 KB
/
build-and-test-in-memory.yml
File metadata and controls
69 lines (57 loc) · 1.96 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
name: In-Memory VSS Server CI
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-in-memory:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create in-memory config
run: |
mkdir -p rust/server
cat > rust/server/vss-server-config.toml <<EOF
[server_config]
bind_address = "127.0.0.1:8080"
store_type = "in-memory"
EOF
- name: Build server
working-directory: rust
run: RUSTFLAGS="--cfg noop_authorizer" cargo build --release --no-default-features --bin vss-server
- name: Start VSS server
working-directory: rust
run: |
./target/release/vss-server ./server/vss-server-config.toml > server.log 2>&1 &
echo "Server PID: $!"
- name: Wait for server
run: |
for i in {1..15}; do
if curl -s http://127.0.0.1:8080/vss > /dev/null; then
echo "Server is up!"
exit 0
fi
sleep 1
done
echo "Server failed. Dumping log:"
cat rust/server.log
exit 1
- name: HTTP Smoke Test
run: |
sudo apt-get update && sudo apt-get install -y xxd
curl -f \
-H "Authorization: Bearer test_user" \
--data-binary @<(echo "0A04746573741A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631" | xxd -r -p) \
http://127.0.0.1:8080/vss/putObjects
RESPONSE=$(curl -f \
-H "Authorization: Bearer test_user" \
--data-binary @<(echo "0A047465737412026B31" | xxd -r -p) \
http://127.0.0.1:8080/vss/getObject)
- name: Run In-Memory unit tests
working-directory: rust
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture