Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.env.base
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cache
# 🪄 MAGE-X CONFIGURATION
# ================================================================================================

MAGE_X_VERSION=v1.8.13 # https://github.com/mrz1836/mage-x/releases
MAGE_X_VERSION=v1.8.14 # https://github.com/mrz1836/mage-x/releases
MAGE_X_USE_LOCAL=false # Use local version for development
MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags
MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/fortress-test-magex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
.mage.yaml
go.mod
${{ env.GO_SUM_FILE }}
magefiles/

# --------------------------------------------------------------------
# Setup MAGE-X using the reusable composite action
Expand Down Expand Up @@ -156,6 +157,7 @@ jobs:
"lint"
"metrics:coverage"
"metrics:loc"
"metrics:mage"
"release"
"release:validate"
"test"
Expand Down Expand Up @@ -206,6 +208,37 @@ jobs:
echo ""
echo "✅ MAGE-X verification completed successfully."

# --------------------------------------------------------------------
# Collect Mage Metrics
# --------------------------------------------------------------------
- name: 📊 Collect Mage Metrics
id: mage-metrics
run: |
set -euo pipefail
echo "📋 Running magex metrics:mage..."

# Run magex metrics:mage and capture output
METRICS_OUTPUT=$(magex metrics:mage 2>&1 || true)
echo "$METRICS_OUTPUT"

# Parse directory found status
if echo "$METRICS_OUTPUT" | grep -q "Magefiles Directory Found: ✅"; then
echo "directory-found=true" >> $GITHUB_OUTPUT
else
echo "directory-found=false" >> $GITHUB_OUTPUT
fi

# Parse total functions count
TOTAL_FUNCTIONS=$(echo "$METRICS_OUTPUT" | grep -oE "Total functions found: [0-9]+" | grep -oE "[0-9]+" || echo "0")
echo "total-functions=$TOTAL_FUNCTIONS" >> $GITHUB_OUTPUT

# Count number of mage files (lines in table excluding header)
FILE_COUNT=$(echo "$METRICS_OUTPUT" | { grep -E "^\| magefiles/" || true; } | wc -l | tr -d ' ')
echo "file-count=$FILE_COUNT" >> $GITHUB_OUTPUT

echo ""
echo "✅ Mage metrics collected successfully."

# --------------------------------------------------------------------
# Summary of MAGE-X verification
# --------------------------------------------------------------------
Expand All @@ -227,6 +260,16 @@ jobs:
echo "| **Missing Commands** | ${{ steps.verify-magex.outputs.missing }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Mage Metrics Section
echo "### 📁 Mage Metrics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Magefiles Directory** | ${{ steps.mage-metrics.outputs.directory-found == 'true' && '✅ Found' || '❌ Not Found' }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Mage Files** | ${{ steps.mage-metrics.outputs.file-count }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Total Functions** | ${{ steps.mage-metrics.outputs.total-functions }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [[ "${{ steps.verify-magex.outputs.missing }}" != "0" ]]; then
echo "🚨 **Missing Commands:** ${{ steps.verify-magex.outputs.missing_commands }}" >> $GITHUB_STEP_SUMMARY
else
Expand Down