chore(pre-commit): Exclude WINDOWS.md from the typos hook regex #47
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Create venv and install package + dev tools | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -e . | |
| pip install pre-commit pytest pytest-asyncio pytest-textual-snapshot pytest-timeout pytest-xdist pyright respx ruff typos vulture debugpy | |
| - name: Add virtual environment to PATH | |
| run: echo "$(pwd)/.venv/bin" >> "$GITHUB_PATH" | |
| - name: Cache pre-commit | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files --show-diff-on-failure | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Create venv and install package + test tools | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-asyncio pytest-textual-snapshot pytest-timeout pytest-xdist respx | |
| - name: Add virtual environment to PATH | |
| run: echo "$(pwd)/.venv/bin" >> "$GITHUB_PATH" | |
| - name: Verify CLI can start | |
| run: | | |
| albert-code --help | |
| albert-acp --help | |
| - name: Install ripgrep | |
| run: sudo apt-get update && sudo apt-get install -y ripgrep | |
| - name: Run tests | |
| run: pytest --ignore tests/snapshots | |
| snapshot-tests: | |
| name: Snapshot Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| - name: Create venv and install package + test tools | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-asyncio pytest-textual-snapshot pytest-timeout pytest-xdist respx | |
| - name: Add virtual environment to PATH | |
| run: echo "$(pwd)/.venv/bin" >> "$GITHUB_PATH" | |
| - name: Run snapshot tests | |
| id: snapshot-tests | |
| run: pytest tests/snapshots | |
| continue-on-error: true | |
| - name: Upload snapshot report | |
| if: steps.snapshot-tests.outcome == 'failure' | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: snapshot-report | |
| path: snapshot_report.html | |
| if-no-files-found: warn | |
| retention-days: 3 | |
| - name: Fail job if snapshot tests failed | |
| if: steps.snapshot-tests.outcome == 'failure' | |
| run: | | |
| echo "Snapshot tests failed, failing job." | |
| exit 1 |