Skip to content
Merged

CI #4

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
scripts/sui filter=lfs diff=lfs merge=lfs -text
scripts/sui-linux.zst filter=lfs diff=lfs merge=lfs -text
64 changes: 37 additions & 27 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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
60 changes: 60 additions & 0 deletions scripts/setup_sui.sh
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions scripts/sui-linux.zst
Git LFS file not shown
Loading