diff --git a/.gitattributes b/.gitattributes index b943111..e668874 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ scripts/sui filter=lfs diff=lfs merge=lfs -text +scripts/sui-linux.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 16707ab..ac1281a 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -2,36 +2,46 @@ name: Integration Test on: pull_request: - branches: [ master, main ] + branches: [master, main] jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Setup Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Install Python dependencies - run: pip install -r scripts/requirements.txt - - - name: Run integration tests - run: python scripts/integration_test.py - - - name: Display test report - if: always() - run: | - echo "## Integration Test Report" >> $GITHUB_STEP_SUMMARY - cat test-report.md >> $GITHUB_STEP_SUMMARY \ No newline at end of file + - uses: actions/checkout@v3 + with: + lfs: true + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install Python dependencies + run: pip install -r scripts/requirements.txt + + - name: Build fuzzer in release mode + run: cargo build --release + + - name: Setup Sui environment + run: | + chmod +x scripts/setup_sui.sh + ./scripts/setup_sui.sh + + - name: Run integration tests + run: python scripts/integration_test.py + + - name: Display test report + if: always() + run: cat test-report.md >> $GITHUB_STEP_SUMMARY diff --git a/scripts/setup_sui.sh b/scripts/setup_sui.sh new file mode 100755 index 0000000..5d3a36f --- /dev/null +++ b/scripts/setup_sui.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Setup Sui binary and client configuration for CI/testing environment + +set -e + +echo "Setting up Sui environment..." + +# Check if we need to setup the Sui binary (typically in CI/Linux environment) +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if [[ "$OSTYPE" == "linux-gnu"* ]] && [[ -f "$SCRIPT_DIR/sui-linux.zst" ]]; then + echo "Setting up Sui binary for Linux..." + cd "$SCRIPT_DIR" + + # Extract the compressed binary + if ! command -v zstd &> /dev/null; then + echo "Error: zstd is required to extract sui-linux.zst" + exit 1 + fi + + zstd -d -f sui-linux.zst -o sui + chmod +x sui + + # Verify the binary + file sui + ls -la sui + echo "✓ Sui binary extracted and made executable" +fi + +echo "Setting up Sui client configuration..." + +# Create Sui config directory +mkdir -p ~/.sui/sui_config + +# Create empty keystore file +echo "[]" > ~/.sui/sui_config/sui.keystore + +# Create client.yaml configuration +cat > ~/.sui/sui_config/client.yaml << 'EOF' +--- +keystore: + File: ~/.sui/sui_config/sui.keystore +external_keys: ~ +envs: + - alias: local + rpc: "http://127.0.0.1:9000" + ws: ~ + basic_auth: ~ +active_env: local +active_address: ~ +EOF + +# Expand ~ to actual home path in the config +sed -i.bak "s|~/.sui/sui_config/sui.keystore|$HOME/.sui/sui_config/sui.keystore|g" ~/.sui/sui_config/client.yaml +rm ~/.sui/sui_config/client.yaml.bak + +echo "✓ Sui client configuration initialized" +echo " Config dir: ~/.sui/sui_config" +echo " Environment: local (http://127.0.0.1:9000)" +echo "✓ Sui environment setup complete" \ No newline at end of file diff --git a/scripts/sui-linux.zst b/scripts/sui-linux.zst new file mode 100755 index 0000000..60771dd --- /dev/null +++ b/scripts/sui-linux.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe96f3782c38e82691a3372369ea4274431a84e32f51d3d3d77aa15d5b5d5295 +size 44033588