-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest-build-targets.sh
More file actions
executable file
·75 lines (60 loc) · 1.83 KB
/
test-build-targets.sh
File metadata and controls
executable file
·75 lines (60 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Test script to verify all build targets work correctly
# This helps ensure the CI/CD workflow will work properly
set -e
echo "🔨 Testing Bera-Reth Build Targets"
echo "=================================="
echo ""
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to test a build target
test_build_target() {
local target=$1
local description=$2
echo -n "Testing $description... "
if make "build-$target" PROFILE=release > /dev/null 2>&1; then
echo -e "${GREEN}✅ PASS${NC}"
return 0
else
echo -e "${RED}❌ FAIL${NC}"
return 1
fi
}
# Check if we're on the right platform for native builds
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
PLATFORM="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM="macos"
else
PLATFORM="other"
fi
echo "Detected platform: $PLATFORM"
echo ""
# Test native build first
echo "Testing native build..."
if cargo build --release > /dev/null 2>&1; then
echo -e "${GREEN}✅ Native build PASS${NC}"
else
echo -e "${RED}❌ Native build FAIL${NC}"
exit 1
fi
echo ""
# Test cross-compilation targets
echo "Testing cross-compilation targets..."
# Linux targets
test_build_target "x86_64-unknown-linux-gnu" "Linux x86_64"
test_build_target "aarch64-unknown-linux-gnu" "Linux aarch64"
# macOS target (only test on macOS, since it can't be cross-compiled from other platforms)
if [[ "$PLATFORM" == "macos" ]]; then
test_build_target "aarch64-apple-darwin" "macOS Apple Silicon"
else
echo -e "${YELLOW}⏭️ Skipping macOS target (requires macOS platform)${NC}"
fi
echo ""
echo "🎉 Build target testing complete!"
echo ""
echo "Note: Some targets may be skipped if not installed locally."
echo "The CI/CD workflow will install all necessary targets automatically."