File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ pull_request :
7+ branches : [ main, master ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v3
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v4
18+ with :
19+ python-version : ' 3.9'
20+
21+ - name : Install dependencies
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install -r requirements.txt
25+ pip install pytest pytest-cov coverage-badge
26+
27+ - name : Run tests with pytest and generate coverage
28+ run : |
29+ pytest --cov=penify_hook tests/ --cov-report=xml --cov-report=term
30+
31+ - name : Generate coverage badge
32+ run : |
33+ coverage-badge -o coverage.svg -f
34+
35+ - name : Commit coverage badge
36+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
37+ run : |
38+ git config --local user.email "action@github.com"
39+ git config --local user.name "GitHub Action"
40+ git add coverage.svg
41+ git diff --quiet && git diff --staged --quiet || git commit -m "Update coverage badge" -a
42+
43+ - name : Push coverage badge
44+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
45+ uses : ad-m/github-push-action@master
46+ with :
47+ github_token : ${{ secrets.GITHUB_TOKEN }}
48+ branch : ${{ github.ref }}
Original file line number Diff line number Diff line change 11# Penify CLI Tool
22
3+ ![ Tests] ( https://github.com/yourorganization/penify-cli/workflows/Tests/badge.svg )
4+ ![ Coverage] ( ./coverage.svg )
5+
36A CLI tool to generate smart commit messages, code documentation, and more.
47
8+ ## Features
9+
10+ - Automatically generate documentation for your code
11+ - Support for multiple programming languages
12+ - Git hook integration for automatic documentation on commits
13+ - Folder and file analysis
14+
515## Installation
616
717Install from PyPI:
@@ -129,6 +139,12 @@ To set up the development environment:
129139 pip install -e .
130140 ```
131141
142+ ### Running Tests
143+
144+ ``` bash
145+ pytest
146+ ```
147+
132148## License
133149
134150This project is licensed under the MIT License.
Original file line number Diff line number Diff line change 11[pytest]
2+ testpaths = tests
23python_files = test_*.py
34python_classes = Test*
45python_functions = test_*
5- testpaths = tests
6+
7+ # Coverage settings
8+ addopts = --cov =penify_hook --cov-report =term --cov-report =xml
Original file line number Diff line number Diff line change 1- # requirements.txt
1+ # Basic requirements
2+ requests >= 2.25.0
3+ gitpython >= 3.1.0
4+ tqdm >= 4.62.0
25
3- requests
4- GitPython
6+ # Testing requirements
7+ pytest >= 7.0.0
8+ pytest-cov >= 4.0.0
9+ coverage >= 6.0.0
10+ coverage-badge >= 1.1.0
You can’t perform that action at this time.
0 commit comments