Skip to content

Commit

Permalink
Add GitHub Actions workflows for formatting, linting, and test covera… (
Browse files Browse the repository at this point in the history
#1)

* Add GitHub Actions workflows for formatting, linting, and test coverage; update README with Codecov badge

* Update test coverage workflow to use 'uv' for dependency installation and test execution
  • Loading branch information
ghodsizadeh authored Jan 5, 2025
1 parent f1f92aa commit acb60cd
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Formatting Check

on: [pull_request]

jobs:
formatting:
runs-on: ubuntu-latest

steps:
- name: Checkout code
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 ruff
- name: Run ruff format
run: ruff format .
24 changes: 24 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linting Check

on: [pull_request]

jobs:
linting:
runs-on: ubuntu-latest

steps:
- name: Checkout code
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 ruff
- name: Run ruff check
run: ruff check .
33 changes: 33 additions & 0 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Coverage

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
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 uv
uv sync
uv pip install pytest pytest-cov
- name: Run tests with coverage
run: uv run pytest --cov=pdf2csv --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<a href="https://pypi.org/project/pdf2csv" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/pdf2csv.svg?color=%2334D058" alt="Supported Python versions">
</a>
<a href="https://codecov.io/gh/ghodsizadeh/pdf2csv" target="_blank">
<img src="https://codecov.io/gh/ghodsizadeh/pdf2csv/branch/main/graph/badge.svg" alt="codecov">
</a>
</p>
This project provides a tool to convert tables from PDF files into CSV or XLSX format using the Docling library. It extracts tables from PDFs and saves them as CSV or XLSX files, optionally reversing text for right-to-left languages.

Expand Down

0 comments on commit acb60cd

Please sign in to comment.