Skip to content

feat: Added in-memory storage for testing purposes #7

feat: Added in-memory storage for testing purposes

feat: Added in-memory storage for testing purposes #7

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: 5
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]
host = "127.0.0.1"
port = 8080
store_type = "in_memory"
EOF
- name: Build server
run: |
cd rust
cargo build --bin server --release
- name: Start VSS server (in-memory)
run: |
cd rust
./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
echo "Server started (PID: $!)"
- name: Wait for server
run: |
sleep 2
for i in {1..15}; do
if curl -s http://127.0.0.1:8080 > /dev/null 2>&1; then
echo "Server is up!"
exit 0
fi
echo "Waiting... ($i)"
sleep 1
done
echo "Server failed to start. Logs:"
cat rust/vss.log
exit 1
- name: Test HTTP API
run: |
PUT_HEX="0A07737465737469643A130A026B3110001A046B317631"
curl -f \
-H "Authorization: Bearer test_user" \
--data-binary @<(echo "$PUT_HEX" | xxd -r -p) \
http://127.0.0.1:8080/vss/putObjects
GET_HEX="0A07737465737469643A026B31"
curl -f \
-H "Authorization: Bearer test_user" \
--data-binary @<(echo "$GET_HEX" | xxd -r -p) \
http://127.0.0.1:8080/vss/getObject
- name: Run tests
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture
- name: Stop VSS server
if: always()
run: |
pkill -f "server/vss-server-config.toml" || true