forked from 4training/pywikitools
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (44 loc) · 1.59 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 -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 .