Skip to content

Commit

Permalink
Update test coverage codecov action.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Dec 4, 2023
1 parent 908fd68 commit 217ba54
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coverage pytest-cov
pip install -e .
- name: Run tests with coverage
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Thumbs.db
htmlcov/
.coverage
.coverage.*
coverage.xml

# Log files
logs/
Expand Down Expand Up @@ -55,4 +56,3 @@ examples/markdown/readme-edgecase.md
readmeai/settings/prompts.toml
readmeai/markdown/data/badges.json
templates/
.github/workflows/coverage.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Automatically generate beautiful README files using OpenAI's GPT language models

Streamlines documentation creation and maintenance, enhancing developer productivity. <em>README-AI</em> aims to improve the adoption of open-source software, enabling all skill levels and disciplines to understand, utilize, and contribute to projects more effectively.<br>

> [!NOTE]
> [!IMPORTANT]
>
> This project is under development with an opinionated setup. It is vital to review the text generated by the OpenAI API to ensure it accurately represents your codebase.<br>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "readmeai"
version = "0.4.062"
version = "0.4.065"
description = "🚀 Generate beautiful README files from the terminal, powered by OpenAI's GPT language models 💫"
authors = ["Eli <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 1 addition & 5 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
eval "$(conda shell.bash hook)"
conda activate readmeai

# Set the directories to include in the coverage report
source_dir="readmeai"

# Set the directories to exclude from the coverage report
omit_dir="tests"

# Exclude __init__.py specifically
omit_file="readmeai/__init__.py,readmeai/*/__init__.py"

# Generate the coverage report and save it to a file
#pytest --cov=./ --cov-report=xml
coverage run --source="$source_dir" --omit="$omit_dir" --omit="$omit_file" -m pytest -v
coverage report --show-missing --fail-under=90

0 comments on commit 217ba54

Please sign in to comment.