feat: implement StateBackend with Pebble and RocksDB support #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: StateStore Test | ||
| on: | ||
| push: | ||
| branches: [ main, master, develop ] | ||
| paths: | ||
| - 'fs/statestore/**' | ||
| - 'scripts/build-rocksdb.sh' | ||
| - 'Makefile' | ||
| - '.github/workflows/statestore-test.yml' | ||
| pull_request: | ||
| branches: [ main, master, develop ] | ||
| paths: | ||
| - 'fs/statestore/**' | ||
| - 'scripts/build-rocksdb.sh' | ||
| - 'Makefile' | ||
| - '.github/workflows/statestore-test.yml' | ||
| workflow_dispatch: | ||
| jobs: | ||
| test-linux: | ||
| name: Test on Linux | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| test-type: [pebble, rocksdb] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
| - name: Install build tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential git curl | ||
| - name: Test Pebble | ||
| if: matrix.test-type == 'pebble' | ||
| run: make test-statestore | ||
| - name: Test RocksDB | ||
| if: matrix.test-type == 'rocksdb' | ||
| run: make test-statestore-rocksdb | ||
| - name: Build with Pebble | ||
| if: matrix.test-type == 'pebble' | ||
| run: make build-lite | ||
| - name: Build with RocksDB | ||
| if: matrix.test-type == 'rocksdb' | ||
| run: make build-all | ||
| - name: Verify binary | ||
| run: | | ||
| if [ ! -f bin/function-stream ]; then | ||
| echo "❌ Binary not found!" | ||
| exit 1 | ||
| fi | ||
| echo "✅ Binary created: bin/function-stream" | ||
| ls -lh bin/function-stream | ||
| - name: Upload Pebble build artifacts | ||
| if: matrix.test-type == 'pebble' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: function-stream-linux-pebble | ||
| path: bin/function-stream | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
| - name: Upload RocksDB build artifacts | ||
| if: matrix.test-type == 'rocksdb' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: function-stream-linux-rocksdb | ||
| path: | | ||
| bin/function-stream | ||
| bin/function-stream/lib/rocksdb/lib/*.a | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
| test-all-statestore: | ||
| name: Test All StateStore Implementations | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
| - name: Install build tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential git curl | ||
| - name: Test Pebble | ||
| run: make test-statestore | ||
| - name: Test RocksDB | ||
| run: make test-statestore-rocksdb | ||
| - name: Build RocksDB variant | ||
| run: make build-all | ||
| - name: Verify build artifacts | ||
| run: | | ||
| echo "=== Build Artifacts ===" | ||
| if [ -f bin/function-stream ]; then | ||
| echo "✅ Binary: bin/function-stream" | ||
| ls -lh bin/function-stream | ||
| else | ||
| echo "❌ Binary not found!" | ||
| exit 1 | ||
| fi | ||
| echo "" | ||
| echo "=== RocksDB Libraries ===" | ||
| if [ -d bin/function-stream/lib/rocksdb/lib ]; then | ||
| ls -lh bin/function-stream/lib/rocksdb/lib/*.a 2>/dev/null || echo "No library files found" | ||
| else | ||
| echo "⚠️ RocksDB library directory not found" | ||
| fi | ||
| - name: Upload all artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: function-stream-linux-complete | ||
| path: | | ||
| bin/function-stream | ||
| bin/function-stream/lib/rocksdb/lib/*.a | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
| summary: | ||
| name: Test Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [test-linux, test-all-statestore] | ||
| if: always() | ||
| steps: | ||
| - name: Generate summary | ||
| run: | | ||
| echo "## 📊 StateStore Test Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Test Results by Platform" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "| Platform | StateStore | Status |" >> $GITHUB_STEP_SUMMARY | ||
| echo "|----------|------------|--------|" >> $GITHUB_STEP_SUMMARY | ||
| echo "| Linux | Pebble | ${{ needs.test-linux.result == 'success' && '✅ Pass' || '❌ Fail' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "| Linux | RocksDB | ${{ needs.test-linux.result == 'success' && '✅ Pass' || '❌ Fail' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Integration Tests" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY | ||
| echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY | ||
| echo "| All Tests (Linux) | ${{ needs.test-all-statestore.result == 'success' && '✅ Pass' || '❌ Fail' }} |" >> $GITHUB_STEP_SUMMARY | ||