Skip to content

Restrict CI pipeline push branches to "tests" #6

Restrict CI pipeline push branches to "tests"

Restrict CI pipeline push branches to "tests" #6

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ "tests"]

Check failure on line 5 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 5
pull_request:
branches: [ "main" ]
jobs:
lint:
name: Lint & Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to the PATH
- name: Add uv to PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies (including dev)
run: uv pip install --system -e '.[test,dev]' # Need dev for ruff
- name: Lint with Ruff
run: uv run ruff check .
- name: Check formatting with Ruff
run: uv run ruff format --check .
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint # Ensure linting passes before testing
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to the PATH
- name: Add uv to PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies (including test)
run: uv pip install --system .
- name: Run tests with pytest
run: uv run pytest -v