Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
---
name: Validate OpenSCAD Models
on:
pull_request:
paths:
- 'models/**/*.scad'
- 'cmd/**'
- '.github/workflows/validate-models.yml'
- 'scadm.json'
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb libglu1-mesa libfuse2 libegl1 libxcb-cursor0
- name: Install OpenSCAD and dependencies
run: |
pip install scadm
scadm install
- name: Validate models
run: |
# Discover scadm-installed library path
LIBS_DIR="$(pwd)/bin/openscad/libraries"
if [ ! -d "$LIBS_DIR" ]; then
echo "WARNING: scadm libraries not found at $LIBS_DIR, trying without OPENSCADPATH"
LIBS_DIR=""
fi
export OPENSCADPATH="${LIBS_DIR}"
# Discover scadm-installed OpenSCAD or fall back to system
if [ -x "$(pwd)/bin/openscad/openscad" ]; then
OPENSCAD="$(pwd)/bin/openscad/openscad"
elif [ -x "$(pwd)/bin/openscad/OpenSCAD.AppImage" ]; then
OPENSCAD="$(pwd)/bin/openscad/OpenSCAD.AppImage"
else
OPENSCAD="openscad"
fi
echo "Using OpenSCAD: $OPENSCAD"
echo "Using libraries: ${OPENSCADPATH:-system default}"
find models -name '*.scad' -not -path '*/makerworld/*' | while read -r model; do
log="/tmp/$(basename "$model" .scad).log"
echo "Rendering $model..."
xvfb-run "$OPENSCAD" --export-format binstl -o /tmp/out.stl "$model" >"$log" 2>&1 || { echo "FAILED: $model"; cat "$log"; exit 1; }
done
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: render-logs
path: /tmp/*.log
retention-days: 7
2221b28cdThis file is pinned to the selected release. Download the original to open it in your design tool.