brown-street/.forgejo/workflows/ifc-lint.yml
Bruno Postle 087a4b9bee
Some checks failed
IDS Compliance Check / ids-lint (push) Failing after 41s
IFC Validation / lint-ifc (push) Failing after 28s
Port IFC and IDS checks to Forgejo Actions
The GitHub workflows could never run here: they ask for runs-on:
ubuntu-latest, which no runner on hub.postle.net offers, so all 8 runs
so far were cancelled. Moved to .forgejo/workflows and pointed at the
`ifc` runner, which serves the pinned ifc-ci image.

The setup steps are gone because the image already contains
ifcopenshell, ifctester, idssplit and pytest, so a run no longer spends
most of its time in setup-python and `pip install ifcopenshell`.

Both bodies are otherwise unchanged apart from skipping libraries/,
which holds vendored component sources rather than deliverable models.

Verified in the ifc-ci container against this model before pushing:
both checks pass, and both were shown to fail when they should --
a corrupted GlobalId exits non-zero, and an IDS rule applying to all 32
windows reports [FAIL] (0/32) and exits 1. That second check matters
because ifctester's CLI never sets an exit code, so the grep for
[FAIL] is what makes the check capable of failing at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T93BEAfP4jvcYo7oMo5AL1
2026-08-31 17:08:09 +01:00

39 lines
1.3 KiB
YAML

# Schema/rule validation for every IFC model in the repo.
#
# Port of .github/workflows/ifc-lint.yml. Only the setup steps and `runs-on:`
# changed: `ifc-ci` already contains ifcopenshell, so there is no setup-python
# and no pip install -- on GitHub those were most of the runtime.
#
# Runs on the user-scoped `ifc` runner (user ci-ifc) on hub.postle.net, whose
# root-owned config.yaml has an empty `valid_volumes`. A job here can mount no
# host path at all, which is what makes it safe to run an outside contributor's
# pull request.
name: IFC Validation
on:
push:
pull_request:
jobs:
lint-ifc:
runs-on: ifc
container:
image: hub.postle.net/bruno/ifc-ci:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run IFC lint checks
# Gates on its own exit status: ifcopenshell.validate calls sys.exit()
# on failure, so `set -e` fails the job.
run: |
set -e
shopt -s globstar nullglob
for file in **/*.ifc; do
# libraries/ holds vendored component sources, not deliverable models.
[[ "$file" == libraries/* ]] && continue
echo "Validating $file..."
python3 -m ifcopenshell.validate --rules "$file"
done