Skip to content

Create test export pdf (#122) #240

Create test export pdf (#122)

Create test export pdf (#122) #240

Workflow file for this run

name: Tests
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Do both in one job run so we only need to install python3-uno once
# (as that is fairly expensive)
python-tests-and-coverage:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install Python uno module (LibreOffice UNO Bridge)
run: |
sudo apt update
sudo apt-get install python3-uno
- name: Install python packages
run: pip install -r requirements.txt
- name: Run all tests
run: python -X dev -m unittest discover -s pywikitools/test
# Now we're generating the coverage report
- name: Install coverage.py
run: pip install coverage
- name: Generate coverage report
run: |
coverage run --source=pywikitools/,pywikitools/correctbot/ --omit=pywikitools/user-config.py -m unittest discover -s pywikitools/test
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
python-code-quality:
# Run flake8 for linting
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install flake8
run: pip install flake8
- name: Run flake8
run: flake8 .