Add per-conversation multiprocess execution and browser interaction/e… #12
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: | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: extension/package-lock.json | |
| - name: Install Python dependencies | |
| run: uv sync --extra dev | |
| - name: Install extension dependencies | |
| working-directory: extension | |
| run: npm ci | |
| - name: Run pre-commit | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| base_sha="${{ github.event.pull_request.base.sha }}" | |
| else | |
| base_sha="${{ github.event.before }}" | |
| fi | |
| if [[ -z "${base_sha}" || "${base_sha}" == "0000000000000000000000000000000000000000" ]]; then | |
| mapfile -t changed_files < <(git ls-files) | |
| else | |
| mapfile -t changed_files < <(git diff --name-only --diff-filter=ACMRTUXB "${base_sha}" "${{ github.sha }}") | |
| fi | |
| if [[ ${#changed_files[@]} -eq 0 ]]; then | |
| echo "No changed files to check." | |
| exit 0 | |
| fi | |
| uv run pre-commit run --show-diff-on-failure --files "${changed_files[@]}" | |
| pytest: | |
| name: Pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install Python dependencies | |
| run: uv sync --extra dev | |
| - name: Run pytest | |
| run: uv run pytest | |
| extension: | |
| name: Extension Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: extension/package-lock.json | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.11' | |
| - name: Install extension dependencies | |
| working-directory: extension | |
| run: npm ci | |
| - name: Run extension tests | |
| working-directory: extension | |
| run: npm test |