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 .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"name": "go-subtree dev container",
"postCreateCommand": "magex lint && magex vet && magex test",
"postStartCommand": "go install github.com/magefile/mage/cmd/magex@latest",
"postStartCommand": "go install github.com/mrz1836/mage-x/cmd/magex@latest",
"remoteUser": "vscode",
"runArgs": [
"--cap-drop=ALL",
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/fortress-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,37 @@ jobs:
runner-os: ${{ inputs.primary-runner }}

# --------------------------------------------------------------------
# Run go vet with parallel execution
# Run go vet with sequential execution to avoid memory issues
# --------------------------------------------------------------------
- name: 🔍 Go vet (parallel)
- name: 🔍 Go vet (sequential)
run: |
echo "🚀 Running static analysis with go vet (parallel mode)..."
echo "🚀 Running static analysis with go vet (sequential mode)..."
GO_MODULE_DIR="${{ env.GO_MODULE_DIR }}"

# Run go vet on packages sequentially to reduce memory usage
if [ -n "$GO_MODULE_DIR" ]; then
echo "🔧 Running magex vet from directory: $GO_MODULE_DIR"
(cd "$GO_MODULE_DIR" && magex vet)
echo "🔧 Running go vet from directory: $GO_MODULE_DIR"
cd "$GO_MODULE_DIR"
else
echo "🔧 Running magex vet from repository root"
magex vet
echo "🔧 Running go vet from repository root"
fi

# Get all packages and vet them one at a time
PACKAGES=$(go list ./... 2>/dev/null | grep -v /vendor/)
TOTAL=$(echo "$PACKAGES" | wc -l | xargs)
CURRENT=0

echo "📦 Found $TOTAL packages to vet"

for pkg in $PACKAGES; do
CURRENT=$((CURRENT + 1))
echo "[$CURRENT/$TOTAL] Vetting $pkg..."
if ! go vet "$pkg"; then
echo "❌ go vet failed on package: $pkg"
exit 1
fi
done

echo "✅ Static analysis completed successfully"

# --------------------------------------------------------------------
Expand All @@ -138,7 +154,7 @@ jobs:
echo "| Analysis Details | Status |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Tool** | go vet (Official Go Static Analyzer) |" >> $GITHUB_STEP_SUMMARY
echo "| **Execution** | Project packages only |" >> $GITHUB_STEP_SUMMARY
echo "| **Execution** | Sequential (memory-optimized) |" >> $GITHUB_STEP_SUMMARY
echo "| **Scope** | ./... (excludes dependencies) |" >> $GITHUB_STEP_SUMMARY
echo "| **Result** | ✅ No issues found |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down