Skip to content

Commit c64b544

Browse files
committed
Add GitHub Actions lint and test workflows, coverage file, and test suite
- Add .coverage file for coverage tracking - Add GitHub Actions lint.yml and tests.yml workflows - Update pyproject.toml with flake8 dev dependency - Generate package metadata in src/ab_cli.egg-info - Add comprehensive test suite for auto‑commit, pr‑description, prompt, rewrite‑history, config, and utils
1 parent 99afcf4 commit c64b544

17 files changed

Lines changed: 2826 additions & 1 deletion

.coverage

84 KB
Binary file not shown.

.github/workflows/lint.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
19+
- name: Install dependencies
20+
run: pip install flake8
21+
22+
- name: Run flake8
23+
run: |
24+
# Run strict lint on tests (must pass)
25+
flake8 tests/ --max-line-length=120 --exclude=__pycache__
26+
# Run lint on src with exit-zero (report only, doesn't fail build)
27+
# TODO: Fix existing src/ issues and remove --exit-zero
28+
flake8 src/ --max-line-length=120 --exclude=__pycache__ --exit-zero
29+
30+
shellcheck:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Run ShellCheck on bin scripts
36+
uses: ludeeus/action-shellcheck@master
37+
with:
38+
scandir: './bin'
39+
severity: warning
40+
41+
- name: Run ShellCheck on scripts
42+
uses: ludeeus/action-shellcheck@master
43+
with:
44+
scandir: './scripts'
45+
severity: warning

.github/workflows/tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[dev]"
29+
30+
- name: Configure git for tests
31+
run: |
32+
git config --global user.email "test@example.com"
33+
git config --global user.name "Test User"
34+
git config --global init.defaultBranch master
35+
36+
- name: Run tests with coverage
37+
run: |
38+
pytest --cov=src/ab_cli --cov-report=xml --cov-report=term -v
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/codecov-action@v4
42+
if: matrix.python-version == '3.12'
43+
with:
44+
files: ./coverage.xml
45+
fail_ci_if_error: false
46+
token: ${{ secrets.CODECOV_TOKEN }}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dependencies = [
4040
dev = [
4141
"pytest>=7.0.0",
4242
"pytest-cov>=4.0.0",
43+
"flake8>=6.0.0",
4344
]
4445

4546
[project.urls]

0 commit comments

Comments
 (0)