First run on the ifc runner failed both jobs at exit 127 with "shopt: not found". The runner executes a `run:` block with /bin/sh (dash) unless the step says otherwise, where GitHub defaults to bash -- so `shopt -s globstar` died before either script reached a file. Setting `shell: bash` explicitly is the fix. The `[[ ]]` tests and the array handling in ids-lint need it too, so this is load-bearing rather than tidiness. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T93BEAfP4jvcYo7oMo5AL1
45 lines
1.6 KiB
YAML
45 lines
1.6 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
|
|
# shell: bash is REQUIRED, not decoration. The runner executes `run:`
|
|
# blocks with /bin/sh (dash) unless told otherwise, so the GitHub
|
|
# original's `shopt -s globstar` dies with "shopt: not found" and
|
|
# exit 127 before the first file is checked. `[[ ]]` and arrays need
|
|
# bash too.
|
|
shell: bash
|
|
# 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
|