diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..f63a5904 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: Tests + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Install ghostscript libmagickwand-dev + run: sudo apt-get install libxml2-utils + - name: Remove policy.xml + run: sudo rm /etc/ImageMagick-6/policy.xml + - name: Check out repo + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - uses: actions/cache@v2 + name: Configure pip caching + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install Python dependencies + run: | + python -m pip install -r requirements.txt + python -m pip install -r requirements-dev.txt + python -m pip install -e . + - name: Run tests + run: |- + pytest --cov=pdfplumber --cov-config=.coveragerc --cov-report xml:coverage.xml --cov-report term + - name: Codecov + uses: codecov/codecov-action@v1.0.12 diff --git a/Makefile b/Makefile index ebe97622..1c849975 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,4 @@ venv: ${PIP} install -e . tests: - ${PYTHON} -m pytest + ${PYTHON} -m pytest --cov=pdfplumber --cov-config=.coveragerc --cov-report xml:coverage.xml --cov-report term diff --git a/requirements-dev.txt b/requirements-dev.txt index d31fbc6c..55fd3f9e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ pandas>=1.0.0 pytest +pytest-cov