-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-setup.sh
More file actions
88 lines (78 loc) · 2.47 KB
/
test-setup.sh
File metadata and controls
88 lines (78 loc) · 2.47 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
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Quick test script for pixi setup
# Run with: bash test-setup.sh
set -e # Exit on error
echo "🧪 Testing pixi setup..."
echo ""
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if pixi is installed
if ! command -v pixi &> /dev/null; then
echo -e "${RED}❌ pixi is not installed${NC}"
echo "Install from: https://pixi.sh/install/"
exit 1
fi
echo -e "${GREEN}✅ pixi is installed${NC}"
echo ""
# Test 1: Install dependencies
echo "1️⃣ Testing dependency installation..."
if pixi install; then
echo -e "${GREEN}✅ Dependencies installed successfully${NC}"
else
echo -e "${RED}❌ Failed to install dependencies${NC}"
exit 1
fi
echo ""
# Test 2: Export requirements.txt
echo "2️⃣ Testing requirements.txt export..."
if pixi run export-requirements; then
if [ -f "requirements.txt" ]; then
echo -e "${GREEN}✅ requirements.txt generated successfully${NC}"
echo " Contents:"
head -5 requirements.txt | sed 's/^/ /'
else
echo -e "${RED}❌ requirements.txt was not created${NC}"
exit 1
fi
else
echo -e "${RED}❌ Failed to export requirements.txt${NC}"
exit 1
fi
echo ""
# Test 3: Build site
echo "3️⃣ Testing Jekyll build..."
if pixi run build; then
if [ -d "_site" ]; then
echo -e "${GREEN}✅ Site built successfully${NC}"
echo " _site directory created"
else
echo -e "${RED}❌ _site directory was not created${NC}"
exit 1
fi
else
echo -e "${RED}❌ Build failed${NC}"
exit 1
fi
echo ""
# Test 4: Test purgecss (if config exists)
if [ -f "purgecss.config.js" ]; then
echo "4️⃣ Testing purgecss..."
if pixi run purgecss; then
echo -e "${GREEN}✅ purgecss ran successfully${NC}"
else
echo -e "${YELLOW}⚠️ purgecss had issues (may be expected if no CSS to purge)${NC}"
fi
echo ""
fi
# Summary
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN}✅ All tests passed!${NC}"
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
echo "Next steps:"
echo " • Run 'pixi run dev' to start the development server"
echo " • Push changes to trigger GitHub Actions workflows"
echo " • Check Actions tab to verify workflows run successfully"