Skip to content

Commit b4344f9

Browse files
claudedeviantintegral
authored andcommitted
ci: add infection setup to session start hook
Download and validate infection.phar following the same GPG verification process used in the GitHub workflow for mutation testing.
1 parent 0604c97 commit b4344f9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.claude/hooks/SessionStart.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,29 @@ else
6464
fi
6565

6666
composer install
67+
68+
# Install infection for mutation testing
69+
echo "Checking for infection..."
70+
if [ ! -f "infection.phar" ]; then
71+
echo "infection is not installed. Downloading infection..."
72+
73+
# Download Infection PHAR and signature
74+
wget https://github.com/infection/infection/releases/download/0.31.9/infection.phar
75+
wget https://github.com/infection/infection/releases/download/0.31.9/infection.phar.asc
76+
77+
# Validate Infection PHAR with GPG
78+
echo "Validating infection signature..."
79+
gpg --keyserver hkps://keys.openpgp.org --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0
80+
gpg --with-fingerprint --verify infection.phar.asc infection.phar
81+
82+
if [ $? -ne 0 ]; then
83+
echo "Error: Failed to validate infection.phar signature."
84+
rm -f infection.phar infection.phar.asc
85+
exit 1
86+
fi
87+
88+
chmod +x infection.phar
89+
echo "infection installed successfully!"
90+
else
91+
echo "infection is already available."
92+
fi

0 commit comments

Comments
 (0)