Update bfsi_results.html #93
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: smartops-ci | |
| on: | |
| push: { branches: [ main, master, feature/** ] } | |
| pull_request: { types: [opened, synchronize, reopened] } | |
| jobs: | |
| build-analyze: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: { python-version: "3.11" } | |
| - name: Install deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyyaml numpy pandas matplotlib scikit-learn | |
| # --- v2 dataset generation + analysis --- | |
| - name: Generate Banking Dataset v2 | |
| run: python tools/generate_bfsi_dataset_v2.py | |
| - name: Analyze Banking Dataset v2 | |
| run: python tools/analyze_bfsi_v2.py | |
| # --- (optional) keep v1 flow as-is --- | |
| - name: Run SmartOps simulation (v1) | |
| env: { PYTHONPATH: . } | |
| run: | | |
| python examples/simulate_pipeline.py --config configs/sample_config.yaml || true | |
| - name: Build v1 deployment summary (if present) | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import os, csv, json, pathlib | |
| root = pathlib.Path(".") | |
| art = pathlib.Path("artifacts"); art.mkdir(exist_ok=True) | |
| p = root / "results_banking" / "banking_impact_summary.csv" | |
| rows = [] | |
| if p.exists(): | |
| with open(p, encoding="utf-8", newline="") as f: | |
| rows = list(csv.DictReader(f)) | |
| md = ["### Banking v1 Deployment Summary", ""] | |
| if rows: | |
| for r in rows: | |
| md.append(f"- **{r['Metric']}**: {r['Before AI Implementation']} → {r['After AI Implementation']} ({r['Improvement %']})") | |
| else: | |
| md.append("_No v1 impact summary found._") | |
| (art / "deploy_summary_v1.md").write_text("\n".join(md), encoding="utf-8") | |
| (art / "deploy_summary_v1.json").write_text(json.dumps({"body":"\n".join(md)}), encoding="utf-8") | |
| print("Wrote artifacts/deploy_summary_v1.md") | |
| PY | |
| - name: Upload artifacts (v1+v2) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smartops-results | |
| path: | | |
| artifacts/** | |
| results_banking/**/*.csv | |
| results_banking/**/*.png | |
| results_banking_v2/**/*.csv | |
| results_banking_v2/**/*.png | |
| if-no-files-found: warn | |
| - name: Comment summary to PR (v1 + v2) | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const v1 = fs.existsSync('artifacts/deploy_summary_v1.json') | |
| ? JSON.parse(fs.readFileSync('artifacts/deploy_summary_v1.json','utf8')).body | |
| : '_No v1 summary._'; | |
| const v2 = fs.existsSync('artifacts/deploy_summary_v2.json') | |
| ? JSON.parse(fs.readFileSync('artifacts/deploy_summary_v2.json','utf8')).body | |
| : '_No v2 summary._'; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: v1 + '\n\n' + v2 | |
| }); |