Sync Extension: v2.4.0 #349
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.11'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Playwright browsers | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install playwright | |
| playwright install chromium | |
| - name: Install dependencies | |
| run: | | |
| pip cache purge || true | |
| pip uninstall -y sentienceapi || true | |
| # Clean any bytecode cache | |
| find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true | |
| find . -type f -name "*.pyc" -delete 2>/dev/null || true | |
| pip install --no-cache-dir -e ".[dev]" | |
| pip install pre-commit mypy types-requests | |
| - name: Verify installed package | |
| shell: bash | |
| run: | | |
| echo "=== Installed sentience location ===" | |
| python -c "import sentience; print(sentience.__file__)" | |
| echo "=== Check assert_done in installed package ===" | |
| python -c "import inspect; from sentience.agent_runtime import AgentRuntime; source = inspect.getsource(AgentRuntime.assert_done); print(source); exit(1) if 'assertTrue' in source else print('Good: assert_ is correctly used')" | |
| - name: Verify source code | |
| shell: bash | |
| run: | | |
| echo "=== Checking agent_runtime.py line 345 ===" | |
| sed -n '340,350p' sentience/agent_runtime.py | |
| echo "=== Verifying assert_ method exists ===" | |
| grep -n "def assert_" sentience/agent_runtime.py | |
| echo "=== Checking for assertTrue (should NOT exist) ===" | |
| if grep -n "assertTrue" sentience/agent_runtime.py; then | |
| echo "ERROR: Found assertTrue - this should have been removed!" | |
| exit 1 | |
| else | |
| echo "Good: no assertTrue found" | |
| fi | |
| - name: Lint with pre-commit | |
| continue-on-error: true | |
| run: | | |
| pre-commit run --all-files | |
| - name: Type check with mypy | |
| continue-on-error: true | |
| run: | | |
| mypy sentience --ignore-missing-imports --no-strict-optional | |
| - name: Check code style | |
| continue-on-error: true | |
| run: | | |
| black --check sentience tests --line-length=100 | |
| isort --check-only --profile black sentience tests | |
| flake8 sentience tests --max-line-length=100 --extend-ignore=E203,W503,E501 --max-complexity=15 | |
| - name: Build extension (if needed) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| if [ -d "../sentience-chrome" ]; then | |
| cd ../sentience-chrome && ./build.sh || echo "Extension build skipped (may not be available in CI)" | |
| else | |
| echo "Extension directory not found, skipping build" | |
| fi | |
| - name: Pre-test verification | |
| shell: bash | |
| run: | | |
| echo "=== Final check before tests ===" | |
| python -c "from sentience.agent_runtime import AgentRuntime; import inspect; source = inspect.getsource(AgentRuntime.assert_done); print('assert_done source:'); print(source); exit(1) if 'assertTrue' in source else print('OK: assert_ is used correctly')" | |
| - name: Run tests | |
| run: | | |
| pytest tests/ -v | |
| env: | |
| CI: true |