Cleanup for release #3
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: Test Autonomi Actions | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
workflow_dispatch: | |
jobs: | |
test-autonomi-actions: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Start Autonomi Network | |
id: start-network | |
uses: grumbach/github_actions/spawn-autonomi-network@v1 | |
with: | |
autonomi-version: 'stable-2025.7.1.3' | |
node-count: '25' | |
enable-evm: 'true' | |
- name: Verify network is running | |
run: | | |
echo "Network Status: ${{ steps.start-network.outputs.network-status }}" | |
echo "Peer Address: ${{ steps.start-network.outputs.peer-address }}" | |
if [ "${{ steps.start-network.outputs.network-status }}" != "running" ]; then | |
echo "❌ Network failed to start properly" | |
exit 1 | |
fi | |
echo "✅ Network is running successfully" | |
- name: Test ant CLI - File Upload and Download | |
run: | | |
echo "Testing ant CLI with network peer: $ANT_PEERS" | |
echo "SECRET_KEY available: ${SECRET_KEY:+YES (${#SECRET_KEY} chars)}${SECRET_KEY:-NO}" | |
# Create a test file | |
echo "Hello Autonomi Network - $(date)" > testfile.txt | |
echo "This is a test file for CI validation" >> testfile.txt | |
echo "Generated at: $(date -u)" >> testfile.txt | |
echo "Test file created with $(wc -c < testfile.txt) bytes" | |
# Verify ant CLI is available | |
echo "Checking ant CLI version..." | |
ant --version | |
# Upload the test file with detailed logging | |
echo "Uploading test file..." | |
echo "Command: ant --local file upload testfile.txt --public" | |
if ! ant --local file upload testfile.txt --public > upload_output.txt 2>&1; then | |
echo "❌ File upload failed" | |
echo "Upload output:" | |
cat upload_output.txt | |
echo "Environment variables:" | |
env | grep -E "(ANT_|SECRET_|EVM_)" || echo "No relevant env vars found" | |
exit 1 | |
fi | |
echo "Upload completed, output:" | |
cat upload_output.txt | |
# Extract the file address from upload output - try multiple patterns | |
echo "Extracting file address..." | |
FILE_ADDR=$(grep -oE 'At address: [A-Fa-f0-9]+' upload_output.txt | cut -d' ' -f3 || echo "") | |
if [ -z "$FILE_ADDR" ]; then | |
echo "❌ Failed to extract file address from upload output" | |
echo "Tried patterns: 'At address: [hex]+'" | |
echo "Full upload output was:" | |
cat upload_output.txt | |
exit 1 | |
fi | |
echo "✅ File uploaded successfully with address: $FILE_ADDR" | |
# Download the file back | |
echo "Downloading file from address: $FILE_ADDR" | |
if ! ant --local file download "$FILE_ADDR" downloadedfile.txt 2>&1; then | |
echo "❌ File download failed" | |
exit 1 | |
fi | |
# Verify the downloaded file exists and matches the original | |
echo "Verifying downloaded file..." | |
if [ ! -f "downloadedfile.txt" ]; then | |
echo "❌ Downloaded file does not exist" | |
exit 1 | |
fi | |
echo "Downloaded file size: $(wc -c < downloadedfile.txt) bytes" | |
if cmp -s testfile.txt downloadedfile.txt; then | |
echo "✅ File download successful - content matches original" | |
else | |
echo "❌ Downloaded file does not match original" | |
echo "Original file content:" | |
cat testfile.txt | |
echo "Downloaded file content:" | |
cat downloadedfile.txt | |
exit 1 | |
fi | |
echo "🎉 Ant CLI test completed successfully!" | |
- name: Cleanup Autonomi Network | |
if: always() | |
uses: grumbach/github_actions/cleanup-autonomi-network@v1 | |
with: | |
upload-logs: 'true' | |
keep-directories: 'false' |