Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
### https://git-scm.com/docs/gitattributes

# When `text` is set to "auto", the path is marked for automatic end-of-line conversion.
# If Git decides that the content is text, its line endings are converted to LF on checkin.
# When the file has been committed with CRLF, no conversion is done.
# https://git-scm.com/docs/gitattributes#Documentation/gitattributes.txt-Settostringvalueauto
* text=auto eol=lf

# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf

# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf


# These files are text and should be normalized (Convert crlf => lf)
# Setting the `text` attribute on a path enables end-of-line normalization and marks the path as a text file.
# End-of-line conversion takes place without guessing the content type.
# https://git-scm.com/docs/gitattributes#_text
*.css text
*.html text
*.js* text
*.md text
*.py text
*.sh text

# These files are binary and should be left untouched
# `binary` is a built-in macro for `-text` `-diff` (ie unset `text` and `diff`)
# https://git-scm.com/docs/gitattributes#_using_macro_attributes
*.7z binary
*.bin binary
*.cu.o binary
*.db binary
*.doc binary
*.docx binary
*.gif binary
*.gz binary
*.heic* binary
*.heif* binary
*.jar binary
*.jpeg binary
*.jpg binary
*.mov binary
*.mp* binary
*.npy binary
*.npz binary
*.parquet binary
*.pcd binary
*.pdf binary
*.pkl binary
*.png binary
*.ppt binary
*.pptx binary
*.pth binary
*.so binary
*.webp binary
*.xls binary
*.xlsx binary
*.zip binary

# Track with LFS
# *.pth filter=lfs diff=lfs merge=lfs -text

# These files should not be processed by Linguist for language detection on GitHub.com
*.p linguist-detectable=false
*.gz linguist-detectable=false
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI Workflow

on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:

jobs:
docs_build:
name: Docs build (MkDocs --strict)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.14"
enable-cache: true

- name: Build docs
working-directory: responses
run: |
uv sync --frozen --extra docs
uv run --no-sync mkdocs build --strict -f ../mkdocs.yml

pytest:
name: Pytest
runs-on: ubuntu-latest
env:
VR_PYODIDE_CACHE_DIR: ~/.cache/agentic-stacks/pyodide

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.14"
enable-cache: true

- name: Cache Pyodide runtime
uses: actions/cache@v4
with:
path: ~/.cache/agentic-stacks/pyodide
key: pyodide-0.29.1-${{ runner.os }}

- name: Sync (locked)
working-directory: responses
run: uv sync --frozen --extra test

- name: Bootstrap Pyodide cache (required for code interpreter tests)
run: |
python scripts/ci/bootstrap_pyodide_cache.py

- name: Build code interpreter binary (required for code interpreter tests)
run: |
bash scripts/ci/prebuild_code_interpreter_linux_x86_64.sh responses

- name: Run tests
working-directory: responses
run: uv run --no-sync pytest -q
106 changes: 106 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Linting Workflow

on:
pull_request:
push:
branches:
- "*"

jobs:
python_lint:
name: Python linting and formatting checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.14"
enable-cache: true

- name: Sync (locked)
working-directory: responses
run: uv sync --frozen --extra lint

- name: Check Python files using Ruff
working-directory: responses
run: |
uv run --no-sync ruff check --output-format github --config pyproject.toml ..
uv run --no-sync ruff format --diff --config pyproject.toml ..

prettier_lint:
name: Prettier Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24

- name: Check files using Prettier
# .prettierignore excludes Markdown files (handled by mdformat)
run: npx prettier@3.8 --check .

markdown_format:
name: Markdown Format Check (mdformat)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.14"
enable-cache: true

- name: Sync (locked)
working-directory: responses
run: uv sync --frozen --extra lint

- name: Check Markdown formatting
working-directory: responses
run: |
# --no-validate allows files with complex MkDocs syntax to be checked
# Some files with advanced admonitions may fail strict HTML validation
uv run --no-sync mdformat --check --no-validate ../docs/ || (echo "Run 'cd responses && uv sync --active --extra lint' then 'uv run mdformat ../docs/' locally to fix" && exit 1)

markdown_lint:
name: Markdown Lint (markdownlint-cli)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24

- name: Lint Markdown files
run: npx markdownlint-cli@0.47.0 docs/
66 changes: 66 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy Docs (GitHub Pages)

on:
push:
branches:
- "main"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Build MkDocs site
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.14"
enable-cache: true

- name: Build docs (locked)
working-directory: responses
run: |
uv sync --frozen --extra docs
uv run --no-sync mkdocs build --strict -f ../mkdocs.yml -d "${GITHUB_WORKSPACE}/site"

- name: Verify site artifact exists
run: |
test -d site
test -f site/index.html
ls -la site | head -n 50

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
Loading
Loading