feat: scaffold bioreactor-v1 project — config, behaviors, workbench, … #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Projects | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| validate: | |
| name: Validate project configs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install PyYAML | |
| run: pip install pyyaml | |
| - name: Validate all YAML files | |
| run: | | |
| python - <<'EOF' | |
| import sys, pathlib, yaml | |
| errors = [] | |
| for f in pathlib.Path("projects").rglob("*.yaml"): | |
| try: | |
| yaml.safe_load(f.read_text()) | |
| except yaml.YAMLError as e: | |
| errors.append(f"{f}: {e}") | |
| if errors: | |
| print("YAML validation errors:") | |
| for e in errors: | |
| print(f" {e}") | |
| sys.exit(1) | |
| print(f"Validated {sum(1 for _ in pathlib.Path('projects').rglob('*.yaml'))} YAML files OK") | |
| EOF | |
| - name: Check machine-profile.yaml exists in each project | |
| run: | | |
| python - <<'EOF' | |
| import sys, pathlib | |
| errors = [] | |
| for project in pathlib.Path("projects").iterdir(): | |
| if not project.is_dir(): | |
| continue | |
| mp = project / "machine-profile.yaml" | |
| if not mp.exists(): | |
| errors.append(f"{project}: missing machine-profile.yaml") | |
| if errors: | |
| print("Missing machine-profile.yaml:") | |
| for e in errors: | |
| print(f" {e}") | |
| sys.exit(1) | |
| print("All projects have machine-profile.yaml") | |
| EOF | |
| - name: Verify no .anpkg files committed | |
| run: | | |
| count=$(find projects -name "*.anpkg" | wc -l) | |
| if [ "$count" -gt 0 ]; then | |
| echo "ERROR: .anpkg files must not be committed:" | |
| find projects -name "*.anpkg" | |
| exit 1 | |
| fi | |
| echo "No .anpkg files found — OK" |