|
| 1 | +name: Apply adaptive contextual-orchestrator default |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - agent/adaptive-orchestrator-default |
| 7 | + paths: |
| 8 | + - scripts/stage_adaptive_soc_default_test.py |
| 9 | + - scripts/apply_adaptive_soc_default.py |
| 10 | + - .github/workflows/apply-adaptive-orchestrator-default.yml |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: write |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: apply-adaptive-orchestrator-default-${{ github.ref }} |
| 17 | + cancel-in-progress: false |
| 18 | + |
| 19 | +jobs: |
| 20 | + red-green-verify: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + timeout-minutes: 60 |
| 23 | + steps: |
| 24 | + - name: Checkout exact branch head |
| 25 | + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + persist-credentials: true |
| 29 | + |
| 30 | + - name: Set up Python |
| 31 | + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # actions/setup-python@v6 |
| 32 | + with: |
| 33 | + python-version: "3.12" |
| 34 | + |
| 35 | + - name: Set up Rust |
| 36 | + uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 |
| 37 | + |
| 38 | + - name: Stage the Rust contract test |
| 39 | + run: python scripts/stage_adaptive_soc_default_test.py |
| 40 | + |
| 41 | + - name: Establish red state or recognize an already-applied source change |
| 42 | + id: red |
| 43 | + shell: bash |
| 44 | + run: | |
| 45 | + set -euo pipefail |
| 46 | + set +e |
| 47 | + cargo test --test adaptive_orchestrator_default > /tmp/wardnet-adaptive-red.log 2>&1 |
| 48 | + status=$? |
| 49 | + set -e |
| 50 | + cat /tmp/wardnet-adaptive-red.log |
| 51 | + if [ "$status" -eq 0 ]; then |
| 52 | + echo "already_applied=true" >> "$GITHUB_OUTPUT" |
| 53 | + else |
| 54 | + grep -Eq "FAILED|panicked|test result: FAILED" /tmp/wardnet-adaptive-red.log |
| 55 | + echo "already_applied=false" >> "$GITHUB_OUTPUT" |
| 56 | + fi |
| 57 | +
|
| 58 | + - name: Apply SOC payload, ADR, and changelog changes |
| 59 | + run: python scripts/apply_adaptive_soc_default.py |
| 60 | + |
| 61 | + - name: Format Rust source |
| 62 | + run: cargo fmt --all |
| 63 | + |
| 64 | + - name: Prove the focused regression is green |
| 65 | + run: cargo test --test adaptive_orchestrator_default |
| 66 | + |
| 67 | + - name: Run complete Rust tests |
| 68 | + run: cargo test --workspace |
| 69 | + |
| 70 | + - name: Run clippy with warnings denied |
| 71 | + run: cargo clippy --workspace --all-targets -- -D warnings |
| 72 | + |
| 73 | + - name: Verify formatting and patch integrity |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + cargo fmt --all -- --check |
| 77 | + git diff --check |
| 78 | +
|
| 79 | + - name: Publish the verified source commit |
| 80 | + env: |
| 81 | + TARGET_BRANCH: agent/adaptive-orchestrator-default |
| 82 | + shell: bash |
| 83 | + run: | |
| 84 | + set -euo pipefail |
| 85 | + rm scripts/stage_adaptive_soc_default_test.py |
| 86 | + rm scripts/apply_adaptive_soc_default.py |
| 87 | + rm .github/workflows/apply-adaptive-orchestrator-default.yml |
| 88 | + git config user.name "github-actions[bot]" |
| 89 | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 90 | + git add --all |
| 91 | + git diff --cached --check |
| 92 | + git commit -m "feat(ai): delegate SOC analysis to adaptive orchestration" |
| 93 | + git push origin "HEAD:${TARGET_BRANCH}" |
0 commit comments