Update helix_ci.yml #58
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: Helix-TTD Core CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 | |
| # Install dependencies required by setup.py | |
| pip install cryptography rich colorama streamlit | |
| # Install Helix in editable mode to check setup.py validity | |
| pip install -e . | |
| - name: Debug File Structure | |
| run: | | |
| echo "📂 Root Directory:" | |
| ls -la | |
| echo "📂 CLI Directory:" | |
| ls -la cli/ || echo "❌ CLI dir missing" | |
| - name: Verify CLI (Direct Python Execution) | |
| env: | |
| PYTHONPATH: . | |
| run: | | |
| python3 helix.py version | |
| - name: Run Integration Suite (The Golden Path) | |
| env: | |
| PYTHONPATH: . | |
| run: | | |
| # 1. Create Artifacts Directory | |
| mkdir -p artifacts | |
| # 2. Mint New Agent | |
| echo "🧬 Minting Agent..." | |
| python3 helix.py new-agent --custodian "CI_PIPELINE_KEY" --name "Test_Agent_01" --output-dir artifacts | |
| # 3. Verify Agent | |
| echo "🔍 Verifying Agent..." | |
| python3 helix.py verify --dbc artifacts/*.dbc.json --suitcase artifacts/*.suitcase.json | |
| # 4. Update State | |
| echo "🔄 Updating State..." | |
| python3 helix.py update-state --dbc artifacts/*.dbc.json --suitcase artifacts/*.suitcase.json --state ACTIVE --reason "CI Pipeline Validation" | |
| # 5. List Agents | |
| python3 helix.py list --directory artifacts | |
| # --- SUPPLY CHAIN SECURITY --- | |
| - name: 🛡️ Generate SBOM (Syft) | |
| uses: anchore/sbom-action@v0 | |
| with: | |
| path: . | |
| format: spdx-json | |
| output-file: artifacts/helix-sbom-${{ matrix.python-version }}.spdx.json | |
| # CRITICAL FIX: Make the upload name unique per matrix job | |
| artifact-name: sbom-py${{ matrix.python-version }} | |
| upload-artifact: false | |
| # --- THE CUSTODY GATE (ROBUST CHECK) --- | |
| - name: Assert Artifacts Exist | |
| run: | | |
| echo "🔍 Auditing Artifacts directory..." | |
| ls -la artifacts/ | |
| # Check for DBC (The Identity) | |
| count_dbc=$(find artifacts -maxdepth 1 -name "*.dbc.json" | wc -l) | |
| if [ "$count_dbc" -eq 0 ]; then | |
| echo "❌ FAILURE: No DBC (Identity) found." | |
| exit 1 | |
| fi | |
| # Check for SUITCASE (The Log) | |
| count_case=$(find artifacts -maxdepth 1 -name "*.suitcase.json" | wc -l) | |
| if [ "$count_case" -eq 0 ]; then | |
| echo "❌ FAILURE: No Suitcase (Log) found." | |
| exit 1 | |
| fi | |
| # Check for SBOM (The Supply Chain) | |
| count_sbom=$(find artifacts -maxdepth 1 -name "*.spdx.json" | wc -l) | |
| if [ "$count_sbom" -eq 0 ]; then | |
| echo "❌ FAILURE: No SBOM (Supply Chain) found." | |
| exit 1 | |
| fi | |
| echo "✅ CUSTODY GATE PASSED: Identity ($count_dbc), Log ($count_case), and SBOM ($count_sbom) verified." | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: helix-test-output-${{ matrix.python-version }} | |
| path: artifacts/ |