6868 .mage.yaml
6969 go.mod
7070 ${{ env.GO_SUM_FILE }}
71+ magefiles/
7172
7273 # --------------------------------------------------------------------
7374 # Setup MAGE-X using the reusable composite action
@@ -156,6 +157,7 @@ jobs:
156157 "lint"
157158 "metrics:coverage"
158159 "metrics:loc"
160+ "metrics:mage"
159161 "release"
160162 "release:validate"
161163 "test"
@@ -206,6 +208,37 @@ jobs:
206208 echo ""
207209 echo "✅ MAGE-X verification completed successfully."
208210
211+ # --------------------------------------------------------------------
212+ # Collect Mage Metrics
213+ # --------------------------------------------------------------------
214+ - name : 📊 Collect Mage Metrics
215+ id : mage-metrics
216+ run : |
217+ set -euo pipefail
218+ echo "📋 Running magex metrics:mage..."
219+
220+ # Run magex metrics:mage and capture output
221+ METRICS_OUTPUT=$(magex metrics:mage 2>&1 || true)
222+ echo "$METRICS_OUTPUT"
223+
224+ # Parse directory found status
225+ if echo "$METRICS_OUTPUT" | grep -q "Magefiles Directory Found: ✅"; then
226+ echo "directory-found=true" >> $GITHUB_OUTPUT
227+ else
228+ echo "directory-found=false" >> $GITHUB_OUTPUT
229+ fi
230+
231+ # Parse total functions count
232+ TOTAL_FUNCTIONS=$(echo "$METRICS_OUTPUT" | grep -oE "Total functions found: [0-9]+" | grep -oE "[0-9]+" || echo "0")
233+ echo "total-functions=$TOTAL_FUNCTIONS" >> $GITHUB_OUTPUT
234+
235+ # Count number of mage files (lines in table excluding header)
236+ FILE_COUNT=$(echo "$METRICS_OUTPUT" | { grep -E "^\| magefiles/" || true; } | wc -l | tr -d ' ')
237+ echo "file-count=$FILE_COUNT" >> $GITHUB_OUTPUT
238+
239+ echo ""
240+ echo "✅ Mage metrics collected successfully."
241+
209242 # --------------------------------------------------------------------
210243 # Summary of MAGE-X verification
211244 # --------------------------------------------------------------------
@@ -227,6 +260,16 @@ jobs:
227260 echo "| **Missing Commands** | ${{ steps.verify-magex.outputs.missing }} |" >> $GITHUB_STEP_SUMMARY
228261 echo "" >> $GITHUB_STEP_SUMMARY
229262
263+ # Mage Metrics Section
264+ echo "### 📁 Mage Metrics" >> $GITHUB_STEP_SUMMARY
265+ echo "" >> $GITHUB_STEP_SUMMARY
266+ echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
267+ echo "|---|---|" >> $GITHUB_STEP_SUMMARY
268+ echo "| **Magefiles Directory** | ${{ steps.mage-metrics.outputs.directory-found == 'true' && '✅ Found' || '❌ Not Found' }} |" >> $GITHUB_STEP_SUMMARY
269+ echo "| **Mage Files** | ${{ steps.mage-metrics.outputs.file-count }} |" >> $GITHUB_STEP_SUMMARY
270+ echo "| **Total Functions** | ${{ steps.mage-metrics.outputs.total-functions }} |" >> $GITHUB_STEP_SUMMARY
271+ echo "" >> $GITHUB_STEP_SUMMARY
272+
230273 if [[ "${{ steps.verify-magex.outputs.missing }}" != "0" ]]; then
231274 echo "🚨 **Missing Commands:** ${{ steps.verify-magex.outputs.missing_commands }}" >> $GITHUB_STEP_SUMMARY
232275 else
0 commit comments