Files
hermes-agent/.github/workflows/tests.yml
Alexander Whitestone 62925c294d
Some checks failed
Contributor Attribution Check / check-attribution (pull_request) Failing after 32s
Docker Build and Publish / build-and-push (pull_request) Has been skipped
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 24s
Tests / lint-paths (pull_request) Failing after 24s
Tests / e2e (pull_request) Successful in 2m14s
Tests / test (pull_request) Failing after 1h6m43s
ci: integrate hardcoded path linter into CI workflow (#865)
PR #864 adds lint_hardcoded_paths.py but it's not in CI.

New scripts/lint_hardcoded_paths.py:
- Scans for 6 hardcoded ~/.hermes path patterns
- Skips hermes_constants.py (source of truth), comments, docs
- --json output, --fix suggestions
- Exit code 1 on findings (fails CI)

Updated .github/workflows/tests.yml:
- New lint-paths job runs on every push/PR to main
- Runs: python3 scripts/lint_hardcoded_paths.py
- Separate from test job for fast failure

Closes #865
2026-04-15 23:45:30 -04:00

92 lines
2.3 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
# Cancel in-progress runs for the same PR/branch
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ripgrep
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
- name: Set up Python 3.11
run: uv python install 3.11
- name: Install dependencies
run: |
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -e ".[all,dev]"
- name: Run tests
run: |
source .venv/bin/activate
python -m pytest tests/ -q --ignore=tests/integration --ignore=tests/e2e --tb=short -n auto
env:
# Ensure tests don't accidentally call real APIs
OPENROUTER_API_KEY: ""
OPENAI_API_KEY: ""
NOUS_API_KEY: ""
lint-paths:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Check for hardcoded ~/.hermes paths
run: python3 scripts/lint_hardcoded_paths.py
e2e:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
- name: Set up Python 3.11
run: uv python install 3.11
- name: Install dependencies
run: |
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -e ".[all,dev]"
- name: Run e2e tests
run: |
source .venv/bin/activate
python -m pytest tests/e2e/ -v --tb=short
env:
OPENROUTER_API_KEY: ""
OPENAI_API_KEY: ""
NOUS_API_KEY: ""