Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8a2991797 |
@@ -27,32 +27,3 @@ jobs:
|
||||
|
||||
- name: Lint
|
||||
run: pip install ruff && ruff check molecule_agent/ molecule_plugin/
|
||||
|
||||
all-required:
|
||||
name: all-required
|
||||
needs: [test]
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Assert every required dependency succeeded
|
||||
run: |
|
||||
set -euo pipefail
|
||||
results='${{ toJSON(needs) }}'
|
||||
echo "$results"
|
||||
echo "$results" | python3 -c '
|
||||
import json, sys
|
||||
ns = json.load(sys.stdin)
|
||||
bad = [(k, v.get("result")) for k, v in ns.items()
|
||||
if v.get("result") not in ("success", None, "cancelled", "skipped")]
|
||||
if bad:
|
||||
print("FAIL: jobs not green:", file=sys.stderr)
|
||||
for k, r in bad:
|
||||
print(f" - {k}: {r}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
pending = [(k, v.get("result")) for k, v in ns.items()
|
||||
if v.get("result") is None]
|
||||
if pending:
|
||||
print(f"WARN: {len(pending)} job(s) still in-flight (result=null): " +
|
||||
", ".join(k for k, _ in pending), file=sys.stderr)
|
||||
print(f"OK: all {len(ns)} required jobs succeeded")
|
||||
'
|
||||
|
||||
@@ -41,12 +41,12 @@ import os
|
||||
import sys
|
||||
|
||||
# Local-dev import path — when installed via pip the molecule_agent package
|
||||
# resolves normally; when running from the repo checkout we add sdk/python/
|
||||
# resolves normally; when running from the repo checkout we add the repo root
|
||||
# to sys.path so you can run `python3 run.py` without a pip install.
|
||||
_here = os.path.dirname(os.path.abspath(__file__))
|
||||
_sdk = os.path.join(_here, "..", "..", "sdk", "python")
|
||||
if os.path.isdir(_sdk) and _sdk not in sys.path:
|
||||
sys.path.insert(0, _sdk)
|
||||
_repo_root = os.path.normpath(os.path.join(_here, "..", ".."))
|
||||
if _repo_root not in sys.path:
|
||||
sys.path.insert(0, _repo_root)
|
||||
|
||||
from molecule_agent import RemoteAgentClient # noqa: E402
|
||||
|
||||
|
||||
Reference in New Issue
Block a user