ci: Add CI and Release workflows and other test fixes (#7)

* ci: add caching and fix workflow failures

- Add UV package caching to all workflows for faster dependency installation
- Add pre-commit hook caching with OS-specific cache keys
- Skip no-commit-to-branch hook in CI (fails on main branch)
- Remove broken apt cache action (doesn't work with PPAs)
- Simplify FreeCAD command detection (PPA installs to standard PATH)
- Add FreeCAD Python version logging for debugging

* ci: Add code Rabbit configuration file

* ci: fix issues in CI workflows

* ci: add uv.lock

* ci: tweaks

* ci: Fix errors and add UUID generation and checking

* ci: Use the GitHub FreeCAD release latest stables

* ci: skip macro test for now, due to headless mode

* feat: Add a multi export macro

* ci: Fix tests

* ci: fix docker build workflow

* ci: skip trufflehog in GitHub Actions due to wasm panic bug

TruffleHog has a known wasm/go-re2 panic bug that causes failures
in GitHub Actions environment. The hook still runs locally during
development for secrets detection.

- Add trufflehog to SKIP env var in pre-commit.yaml
- Update trufflehog to v3.88.7 (latest)
- Add reference to upstream issue #3321

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: use boolean holes instead of PartDesign::Hole in CI

PartDesign::Hole has a CADKernelError bug in FreeCAD AppImage headless
mode on Linux (used in GitHub Actions) where it fails with "Cannot make
face from profile". The SmartCutter class already supports boolean holes
as an alternative.

Changes:
- Modify SmartCutter.execute() to use boolean holes by default
- Update all test assertions for Part::Feature output type
- Update test docstrings and class descriptions
- Remove PartDesign-specific checks (Group, Sketcher::SketchObject)
- Update workflow comment explaining the CI limitation

Boolean holes work reliably in both GUI and headless mode across all
FreeCAD configurations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* ci: clean up GitHub Actions workflows

* ci: Dependabot improvements

* ci: add CodeQL scanning workflow

* ci: AI review suggested improvements

* ci: add coderabbit updates for intentional decisions

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Sean P. Kane
2026-01-04 19:29:25 -08:00
committed by GitHub
co-authored by Claude Opus 4.5
parent 8d1271995e
commit cd77560297
32 changed files with 4992 additions and 408 deletions
+58
View File
@@ -320,6 +320,64 @@ uninstall-cut-macro:
rm -f "$MACRO_DIR/CutObjectForMagnets.svg"
echo "CutObjectForMagnets macro uninstalled"
# Install the MultiExport macro to FreeCAD's macro directory
install-export-macro:
#!/usr/bin/env bash
set -euo pipefail
PROJECT_DIR="{{project_root}}"
# Determine macro directory based on OS
if [[ "$OSTYPE" == "darwin"* ]]; then
MACRO_DIR="$HOME/Library/Application Support/FreeCAD/Macro"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
MACRO_DIR="$HOME/.local/share/FreeCAD/Macro"
else
MACRO_DIR="$APPDATA/FreeCAD/Macro"
fi
mkdir -p "$MACRO_DIR"
# Copy the macro file
cp "${PROJECT_DIR}/macros/Multi_Export/MultiExport.FCMacro" "$MACRO_DIR/"
# Optionally copy the icon if it exists
if [[ -f "${PROJECT_DIR}/macros/Multi_Export/MultiExport.svg" ]]; then
cp "${PROJECT_DIR}/macros/Multi_Export/MultiExport.svg" "$MACRO_DIR/"
fi
echo "MultiExport macro installed to: $MACRO_DIR"
echo ""
echo "To use:"
echo " 1. Start FreeCAD"
echo " 2. Select one or more objects to export"
echo " 3. Go to: Macro → Macros → MultiExport → Execute"
echo " 4. Choose export formats (STL, STEP, 3MF selected by default)"
echo " 5. Set output directory and filename"
echo " 6. Click Export"
# Uninstall the MultiExport macro
uninstall-export-macro:
#!/usr/bin/env bash
set -euo pipefail
if [[ "$OSTYPE" == "darwin"* ]]; then
MACRO_DIR="$HOME/Library/Application Support/FreeCAD/Macro"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
MACRO_DIR="$HOME/.local/share/FreeCAD/Macro"
else
MACRO_DIR="$APPDATA/FreeCAD/Macro"
fi
rm -f "$MACRO_DIR/MultiExport.FCMacro"
rm -f "$MACRO_DIR/MultiExport.svg"
echo "MultiExport macro uninstalled"
# Install all macros to FreeCAD's macro directory
install-all-macros: install-bridge-macro install-cut-macro install-export-macro
@echo "All macros installed successfully!"
# Uninstall all macros from FreeCAD's macro directory
uninstall-all-macros: uninstall-bridge-macro uninstall-cut-macro uninstall-export-macro
@echo "All macros uninstalled successfully!"
# =============================================================================
# Plugin Installation
# =============================================================================