-
-
Notifications
You must be signed in to change notification settings - Fork 262
Expand file tree
/
Copy path.cirrus.yml
More file actions
139 lines (130 loc) · 5.27 KB
/
.cirrus.yml
File metadata and controls
139 lines (130 loc) · 5.27 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
task:
name: macOS PCP Build
macos_instance:
image: ghcr.io/cirruslabs/macos-tahoe-base:latest
# Cache Homebrew prefix + download cache
homebrew_cache:
folder: /opt/homebrew
# Also cache downloaded bottles to avoid re-downloading on cache miss/rebuild
# (you can list multiple folders)
# folders:
# - /opt/homebrew
# - ~/Library/Caches/Homebrew
fingerprint_script: |
brew --version
echo $HOMEBREW_NO_AUTO_UPDATE # if you use it
# Hash the package list so the cache busts when we add/remove packages
grep -v '^#' build/mac/brew-packages.txt | sort | shasum
populate_script: |
# This runs only on cache miss — safe to install everything here
echo "Populating Homebrew cache..."
brew update --quiet || true
PACKAGES=$(grep -v '^#' build/mac/brew-packages.txt | grep -v '^$' | tr '\n' ' ')
brew install $PACKAGES || true
# Optional: clean up non-deterministic files before cache upload
before_cache_script: |
brew cleanup --prune=all || true
rm -rf ~/Library/Caches/Homebrew/downloads # optional, if too noisy
#brew_setup_script:
# Now this will be very fast if cache hit
#- echo "Setting up dependencies (cached!)"
# - brew install coreutils gnu-tar pkg-config python3 python-setuptools autoconf || true # idempotent
enable_tcp_stats_script: |
echo "Enabling TCP statistics for testing..."
sudo sysctl -w net.inet.tcp.disable_access_to_stats=0
echo "Verifying setting:"
sysctl net.inet.tcp.disable_access_to_stats
setup_python_env_script: |
./build/mac/setup-python-env.sh build/mac/requirements-build.txt
pcp_build_script: |
[ "$PCP_SKIP_BUILD" == "true" ] && echo "SKIPPING BUILD" || ./Makepkgs --verbose
start_valkey_script: |
brew services start valkey
validate_pmid_consistency_script: |
echo "Validating PMID consistency across pmns, metrics.c, and darwin.h..."
./build/mac/test/integration/test-pmid-consistency.sh
pcp_install_script: |
DMG_PATH=$(find pcp-**/build/mac -name "pcp-*.dmg" | head -1) # Find the generated DMG
echo "Found DMG: $DMG_PATH"
MOUNT_OUTPUT=$(hdiutil attach "$DMG_PATH" | tail -1) # Mount the DMG
VOLUME_PATH=$(echo "$MOUNT_OUTPUT" | awk '{print $3}')
echo "Mounted at: $VOLUME_PATH"
PKG_PATH=$(find "$VOLUME_PATH" -name "*.pkg" | head -1) # Find and install the PKG
echo "Found PKG: $PKG_PATH"
ls -alh $PKG_PATH
pkgutil --check-signature $PKG_PATH || true # this returns 1 when things are ok
sudo installer -pkg "$PKG_PATH" -target / -verbose # Install (sudo is passwordless in GitHub Actions)
check_pmcd_is_running_postinstall_script: |
echo "Waiting for pcp service to start (it can take a while after install)..."
TIMEOUT=180 # 3 minutes
ELAPSED=0
INTERVAL=5
while [ $ELAPSED -lt $TIMEOUT ]; do
if pcp 2>/dev/null; then
echo "pcp service is responding"
break
fi
sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
done
if [ $ELAPSED -ge $TIMEOUT ]; then
echo "ERROR: pcp service failed to start within $TIMEOUT seconds"
exit 1
fi
run_unit_tests_script: |
cd build/mac/test
./run-unit-tests.sh
run_integration_tests_script: |
cd build/mac/test/integration
./run-integration-tests.sh
verify_openmetrics_pmda_script: |
echo "Checking openmetrics PMDA status..."
if pminfo openmetrics 2>/dev/null | head -5; then
echo "openmetrics PMDA is active"
else
echo "WARNING: openmetrics PMDA not active"
test -f /var/lib/pcp/pmdas/openmetrics/.NeedInstall && echo ".NeedInstall marker exists (pending)" || true
test -f /var/lib/pcp/pmdas/openmetrics/.NeedInstall.failed && echo ".NeedInstall.failed exists" || true
sudo grep -i "openmetrics\|NeedInstall\|pmda_setup" /var/log/pcp/pmcd/pmcd.log 2>/dev/null | tail -20 || true
fi
verify_zeroconf_configs_script: |
echo "Checking for zeroconf pmlogconf configs..."
if test -d /var/lib/pcp/config/pmlogconf/zeroconf; then
echo "zeroconf configs installed:"
ls /var/lib/pcp/config/pmlogconf/zeroconf/
else
echo "ERROR: zeroconf config directory not found"
exit 1
fi
check_pmproxy_is_running_script: |
echo "Waiting for pmproxy service to start..."
TIMEOUT=60
ELAPSED=0
INTERVAL=3
while [ $ELAPSED -lt $TIMEOUT ]; do
echo "Checking pmproxy (${ELAPSED}s elapsed)..."
# Check if pmproxy responds to ping
if curl -s http://localhost:44322/series/ping 2>/dev/null | grep -q '"success":true'; then
echo "✓ pmproxy is responding!"
break
fi
sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
done
if [ $ELAPSED -ge $TIMEOUT ]; then
echo "✗ Timeout waiting for pmproxy"
exit 1
fi
echo ""
echo "pmproxy connectivity checks:"
nc -z localhost 44322 && echo "✓ Port 44322 open" || echo "✗ Port 44322 closed"
echo ""
echo "pmproxy process:"
pgrep pmproxy && echo "✓ pmproxy running (PID: $(pgrep pmproxy))" || echo "✗ pmproxy not running"
pause_script: |
if [ "$PCP_PAUSE_AFTER_INSTALL" == "true" ]; then
echo "VM IP: $(ipconfig getifaddr en0)"
sleep 3600 # Keeps VM alive for an hour
else
echo "No pause required, finishing"
fi