Skip to content

Commit f3d11dc

Browse files
authored
Merge pull request #232 from dbcli/amjith/ci-updates
Update GH workflows
2 parents ad08308 + 1798414 commit f3d11dc

File tree

6 files changed

+105
-48
lines changed

6 files changed

+105
-48
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ on:
77
- 'AUTHORS'
88

99
jobs:
10-
build:
10+
tests:
11+
name: Tests
1112
runs-on: ubuntu-latest
1213

1314
strategy:
15+
fail-fast: false
1416
matrix:
1517
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1618

1719
steps:
18-
- uses: actions/checkout@v3
19-
- uses: astral-sh/setup-uv@v1
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
22+
- uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
2023
with:
2124
version: "latest"
2225

@@ -31,5 +34,29 @@ jobs:
3134
- name: Run unit tests
3235
run: uv run tox -e py${{ matrix.python-version }}
3336

34-
- name: Run Style Checks
35-
run: uv run tox -e style
37+
tests-no-extras:
38+
name: Tests Without Extras
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
python-version: ["3.13"] # Just the latest version
45+
46+
steps:
47+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48+
49+
- uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
50+
with:
51+
version: "latest"
52+
53+
- name: Set up Python ${{ matrix.python-version }}
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Install dependencies
59+
run: uv sync --extra dev -p ${{ matrix.python-version }}
60+
61+
- name: Run unit tests
62+
run: uv run tox -e py${{ matrix.python-version }}

.github/workflows/codeql.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.md'
7+
- 'AUTHORS'
8+
9+
jobs:
10+
linters:
11+
name: Linters
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out Git repository
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+
18+
# remember to sync the ruff-check version number with pyproject.toml
19+
- name: Run ruff check
20+
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
21+
with:
22+
version: 0.11.5
23+
24+
# remember to sync the ruff-check version number with pyproject.toml
25+
- name: Run ruff format
26+
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
27+
with:
28+
version: 0.11.5
29+
args: 'format --check'

.github/workflows/publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
runs-on: ubuntu-latest
4040
needs: [test]
4141

42+
strategy:
43+
matrix:
44+
python-version: ["3.13"]
45+
4246
steps:
4347
- uses: actions/checkout@v4
4448
- uses: astral-sh/setup-uv@v1
@@ -48,10 +52,10 @@ jobs:
4852
- name: Set up Python
4953
uses: actions/setup-python@v5
5054
with:
51-
python-version: '3.12'
55+
python-version: {{ matrix.python-version }}
5256

5357
- name: Install dependencies
54-
run: uv sync --all-extras -p 3.12
58+
run: uv sync --all-extras -p {{ matrix.python-version }}
5559

5660
- name: Build
5761
run: uv build

.github/workflows/typecheck.yml

Whitespace-only changes.

AGENTS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `litecli/`: Core package. Entry point `main.py`, SQL execution in `sqlexecute.py`, completion in `packages/completion_engine.py`, special commands under `packages/special/`.
5+
- `tests/`: Pytest suite (files like `test_*.py`). Test data under `tests/data/`.
6+
- `screenshots/`: Images used in README.
7+
- Config template: `litecli/liteclirc` (user config is created under `~/.config/litecli/config` or `%LOCALAPPDATA%/dbcli/litecli/config`).
8+
9+
## Build, Test, and Development Commands
10+
- Create env: `python -m venv .venv && source .venv/bin/activate`.
11+
- Install dev deps: `pip install -e .[dev]`.
12+
- Run all tests + coverage: `tox`.
13+
- Style/lint (ruff): `tox -e style` (runs `ruff check --fix` and `ruff format`).
14+
- Extra tests with SQLean: `tox -e sqlean` (installs `[sqlean]` extras).
15+
- Run tests directly: `pytest -v` or focused: `pytest -k keyword`.
16+
- Launch CLI locally: `litecli path/to.db`.
17+
18+
## Coding Style & Naming Conventions
19+
- Formatter/linter: Ruff (configured via `.pre-commit-config.yaml` and `tox`).
20+
- Indentation: 4 spaces. Line length: 140 (see `pyproject.toml`).
21+
- Naming: modules/functions/variables `snake_case`; classes `CamelCase`; tests `test_*.py`.
22+
- Keep imports sorted and unused code removed (ruff enforces).
23+
24+
## Testing Guidelines
25+
- Framework: Pytest with coverage (`coverage run -m pytest` via tox).
26+
- Location: place new tests in `tests/` alongside related module area.
27+
- Conventions: name files `test_<unit>.py`; use fixtures from `tests/conftest.py`.
28+
- Quick check: `pytest -q`; coverage report via `tox` or `coverage report -m`.
29+
30+
## Commit & Pull Request Guidelines
31+
- Commits: imperative mood, concise scope (e.g., `fix: handle NULL types`). Reference issues (`#123`) when relevant.
32+
- Update `CHANGELOG.md` for user-visible changes.
33+
- PRs: include clear description, steps to reproduce/verify, and screenshots or snippets for CLI output when helpful. Use the PR template.
34+
- Ensure CI passes (tests + ruff). Re-run `tox -e style` before requesting review.
35+
36+
## Security & Configuration Tips
37+
- Do not commit local databases or secrets. Use files under `tests/data/` for fixtures.
38+
- User settings live outside the repo; document defaults by editing `litecli/liteclirc`.

0 commit comments

Comments
 (0)