Optimize database validation performance and fix all test issues #3
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: CD | |
| on: | |
| push: | |
| branches: [ main, develop, testing ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main, develop, testing ] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Set up Node.js | |
| if: ${{ hashFiles('package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json') != '' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21' | |
| - name: Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake \ | |
| make \ | |
| gcc \ | |
| g++ \ | |
| libssl-dev \ | |
| libboost-all-dev \ | |
| libspdlog-dev \ | |
| libgtest-dev \ | |
| nlohmann-json3-dev \ | |
| libfmt-dev \ | |
| libgflags-dev \ | |
| doxygen \ | |
| graphviz \ | |
| curl \ | |
| wget \ | |
| git \ | |
| tar \ | |
| gzip \ | |
| lua5.4 \ | |
| liblua5.4-dev \ | |
| maven | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| **/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock', '**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-build- | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Python dependencies | |
| run: | | |
| pip install --upgrade pip | |
| if [ -f "projects/satox-sdk/requirements.txt" ]; then | |
| pip install -r projects/satox-sdk/requirements.txt | |
| else | |
| echo "requirements.txt not found, installing basic dependencies" | |
| pip install pytest cmake setuptools wheel | |
| fi | |
| if [ -f "projects/satox-sdk/requirements-dev.txt" ]; then | |
| pip install -r projects/satox-sdk/requirements-dev.txt | |
| else | |
| echo "requirements-dev.txt not found, skipping dev dependencies" | |
| fi | |
| - name: Check project structure | |
| run: | | |
| echo "Checking project structure for release..." | |
| ls -la projects/satox-sdk/ | |
| if [ -f "projects/satox-sdk/CMakeLists.txt" ]; then | |
| echo "✅ CMakeLists.txt found" | |
| else | |
| echo "❌ CMakeLists.txt not found" | |
| exit 1 | |
| fi | |
| echo "Checking bindings structure..." | |
| ls -la projects/satox-sdk/bindings/ | |
| if [ -d "projects/satox-sdk/bindings" ]; then | |
| echo "✅ Bindings directory found" | |
| ls -la projects/satox-sdk/bindings/ | |
| else | |
| echo "❌ Bindings directory not found" | |
| exit 1 | |
| fi | |
| - name: Build project | |
| run: | | |
| cd projects/satox-sdk | |
| mkdir -p build && cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DENABLE_INTEGRATION_TESTS=ON \ | |
| -DBUILD_PYTHON_BINDINGS=ON \ | |
| -DBUILD_NODEJS_BINDINGS=ON \ | |
| -DBUILD_GO_BINDINGS=ON \ | |
| -DBUILD_RUST_BINDINGS=ON \ | |
| -DBUILD_JAVA_BINDINGS=ON \ | |
| -DBUILD_CSHARP_BINDINGS=ON \ | |
| -DBUILD_LUA_BINDINGS=ON \ | |
| -DBUILD_WASM_BINDINGS=ON | |
| make -j$(nproc) | |
| - name: Run tests | |
| run: | | |
| cd projects/satox-sdk/build | |
| if [ -f "CTestTestfile.cmake" ]; then | |
| ctest --output-on-failure | |
| else | |
| echo "No tests found, skipping test execution" | |
| fi | |
| - name: Build all bindings | |
| run: | | |
| cd projects/satox-sdk | |
| # Build Python bindings | |
| if [ -d "bindings/python" ]; then | |
| cd bindings/python | |
| python3 setup.py build_ext --inplace | |
| python3 setup.py install | |
| cd ../.. | |
| fi | |
| # Build TypeScript bindings | |
| if [ -d "bindings/typescript" ]; then | |
| cd bindings/typescript | |
| npm install | |
| npm run build | |
| cd ../.. | |
| fi | |
| # Build JavaScript bindings | |
| if [ -d "bindings/javascript" ]; then | |
| cd bindings/javascript | |
| npm install | |
| npm run build | |
| cd ../.. | |
| fi | |
| # Build Go bindings | |
| if [ -d "bindings/go" ]; then | |
| cd bindings/go | |
| go mod tidy | |
| go build -o satox-sdk-go.so -buildmode=c-shared . | |
| cd ../.. | |
| fi | |
| # Build Rust bindings | |
| if [ -d "bindings/rust" ]; then | |
| cd bindings/rust | |
| cargo build --release | |
| cd ../.. | |
| fi | |
| # Build Java bindings | |
| if [ -d "bindings/java" ]; then | |
| cd bindings/java | |
| mvn clean package | |
| cd ../.. | |
| fi | |
| # Build C# bindings | |
| if [ -d "bindings/csharp" ]; then | |
| cd bindings/csharp | |
| dotnet build -c Release | |
| cd ../.. | |
| fi | |
| # Build Lua bindings | |
| if [ -d "bindings/lua" ]; then | |
| cd bindings/lua | |
| make | |
| cd ../.. | |
| fi | |
| # Build WebAssembly bindings | |
| if [ -d "bindings/wasm" ]; then | |
| cd bindings/wasm | |
| npm install | |
| npm run build | |
| cd ../.. | |
| fi | |
| - name: Generate documentation | |
| run: | | |
| cd projects/satox-sdk | |
| if [ -f "Doxyfile" ]; then | |
| doxygen Doxyfile | |
| echo "✅ Documentation generated" | |
| else | |
| echo "⚠️ Doxyfile not found, skipping documentation generation" | |
| fi | |
| - name: Check for clean script | |
| run: | | |
| if [ -f "scripts/clean_release.sh" ]; then | |
| echo "✅ Clean script found" | |
| chmod +x scripts/clean_release.sh | |
| else | |
| echo "❌ Clean script not found at scripts/clean_release.sh" | |
| exit 1 | |
| fi | |
| - name: Clean repository for release | |
| run: | | |
| echo "Running clean script for release..." | |
| ./scripts/clean_release.sh | |
| echo "✅ Repository cleaned for release" | |
| - name: Create release artifacts | |
| run: | | |
| cd projects/satox-sdk | |
| mkdir -p release_artifacts | |
| echo "Creating release artifacts..." | |
| # Copy libraries | |
| if [ -d "build/lib" ]; then | |
| find build/lib -name "*.so" -exec cp {} release_artifacts/ \; 2>/dev/null || true | |
| find build/lib -name "*.a" -exec cp {} release_artifacts/ \; 2>/dev/null || true | |
| else | |
| find build -name "*.so" -exec cp {} release_artifacts/ \; 2>/dev/null || true | |
| find build -name "*.a" -exec cp {} release_artifacts/ \; 2>/dev/null || true | |
| fi | |
| # Copy headers | |
| if [ -d "include" ]; then | |
| mkdir -p release_artifacts/include | |
| cp -r include/* release_artifacts/include/ 2>/dev/null || true | |
| fi | |
| # Copy documentation | |
| if [ -d "docs/html" ]; then | |
| cp -r docs/html release_artifacts/ | |
| elif [ -d "docs/doxygen/html" ]; then | |
| cp -r docs/doxygen/html release_artifacts/ | |
| fi | |
| # Copy examples | |
| if [ -d "examples" ]; then | |
| mkdir -p release_artifacts/examples | |
| cp -r examples/* release_artifacts/examples/ 2>/dev/null || true | |
| fi | |
| # Copy bindings | |
| if [ -d "bindings" ]; then | |
| mkdir -p release_artifacts/bindings | |
| cp -r bindings/* release_artifacts/bindings/ 2>/dev/null || true | |
| fi | |
| # Copy configuration files | |
| cp CMakeLists.txt release_artifacts/ 2>/dev/null || true | |
| cp README.md release_artifacts/ 2>/dev/null || true | |
| cp LICENSE release_artifacts/ 2>/dev/null || true | |
| cp CONTRIBUTING.md release_artifacts/ 2>/dev/null || true | |
| # Create version file | |
| echo "Satox SDK Version ${GITHUB_REF#refs/tags/}" > release_artifacts/VERSION | |
| echo "Build Date: $(date)" >> release_artifacts/VERSION | |
| echo "Build Type: Release" >> release_artifacts/VERSION | |
| echo "Build System: GitHub Actions" >> release_artifacts/VERSION | |
| echo "Supported Bindings: Python, TypeScript, JavaScript, Go, Rust, Java, C#, Lua, WebAssembly" >> release_artifacts/VERSION | |
| # Create checksums | |
| cd release_artifacts | |
| find . -type f -not -name "SHA256SUMS" -exec sha256sum {} \; > SHA256SUMS | |
| # Create archive | |
| cd .. | |
| tar -czf satox-sdk-${GITHUB_REF#refs/tags/}-release.tar.gz -C release_artifacts . | |
| echo "✅ Release artifacts created successfully" | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Satox SDK ${{ github.ref_name }} | |
| body: | | |
| ## Satox SDK Release ${{ github.ref_name }} | |
| ### Features | |
| - Core blockchain integration | |
| - Quantum-resistant security | |
| - Multi-language bindings (Python, TypeScript, JavaScript, Go, Rust, Java, C#, Lua, WebAssembly) | |
| - Comprehensive documentation | |
| ### Installation | |
| Download the release artifacts and run the installation script. | |
| ### Documentation | |
| See the included documentation for usage examples and API reference. | |
| ### Bindings | |
| This release includes bindings for the following languages: | |
| - **Python**: Full SDK integration with pip installation | |
| - **TypeScript/JavaScript**: Node.js and browser support | |
| - **Go**: Native Go bindings with modules | |
| - **Rust**: Safe Rust bindings with Cargo | |
| - **Java**: Maven package with JNI | |
| - **C#**: .NET bindings with NuGet | |
| - **Lua**: Scripting language bindings | |
| - **WebAssembly**: Browser and Node.js WASM support | |
| ### Build Information | |
| - Build Date: $(date) | |
| - Build System: GitHub Actions | |
| - Platform: Ubuntu Latest | |
| draft: false | |
| prerelease: false | |
| - name: Upload Release Assets | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./projects/satox-sdk/satox-sdk-${{ github.ref_name }}-release.tar.gz | |
| asset_name: satox-sdk-${{ github.ref_name }}-release.tar.gz | |
| asset_content_type: application/gzip | |
| - name: Upload Release Directory | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./projects/satox-sdk/release_artifacts/ | |
| asset_name: satox-sdk-${{ github.ref_name }}-files.zip | |
| asset_content_type: application/zip | |
| - name: Final cleanup and commit | |
| run: | | |
| # Ensure clean commit history | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| # Add any remaining changes | |
| git add . | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git commit -m "Clean up after release ${{ github.ref_name }}" | |
| git push | |
| fi | |
| echo "✅ Release process completed successfully" |