| 1 |
# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 |
|
| 4 |
name: Tests |
| 5 |
|
| 6 |
on: |
| 7 |
workflow_call: |
| 8 |
inputs: |
| 9 |
python-version: |
| 10 |
required: true |
| 11 |
type: string |
| 12 |
extra-requirements: |
| 13 |
required: false |
| 14 |
type: string |
| 15 |
|
| 16 |
jobs: |
| 17 |
build: |
| 18 |
|
| 19 |
runs-on: ubuntu-latest |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v2 |
| 23 |
- name: Set up Python ${{ inputs.python-version }} |
| 24 |
uses: actions/setup-python@v2 |
| 25 |
with: |
| 26 |
python-version: ${{ inputs.python-version }} |
| 27 |
- name: Display Python version |
| 28 |
run: python -c "import sys; print(sys.version)" |
| 29 |
- name: Install dependencies |
| 30 |
run: | |
| 31 |
python -m pip install --upgrade pip |
| 32 |
pip install pytest pytest-cov codecov beautifulsoup4 ${{ inputs.extra-requirements }} -e . |
| 33 |
- name: Test with pytest |
| 34 |
run: | |
| 35 |
pytest --cov=autodocsumm --cov-report=xml tests |
| 36 |
- name: Upload codecov |
| 37 |
env: |
| 38 |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 39 |
run: | |
| 40 |
codecov |