-
Notifications
You must be signed in to change notification settings - Fork 194
87 lines (72 loc) · 2.43 KB
/
doctest.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Doctest CI
# Run Pywikibot doctests with a variety of Python versions
on:
push:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYWIKIBOT_TEST_RUNNING: 1
PYWIKIBOT_USERNAME: Pywikibot-test
jobs:
build:
runs-on: ${{ matrix.os || 'ubuntu-latest'}}
timeout-minutes: 10
strategy:
fail-fast: false
max-parallel: 7
matrix:
os: [ "windows-latest", "macOS-latest", "ubuntu-latest" ]
python-version: ["pypy3.7", "3.11"]
include:
- python-version: "3.12.0-alpha - 3.12.0"
- python-version: "3.13-dev"
# ubuntu-20.04 required for Python 3.6
- python-version: 3.6
os: windows-latest
- python-version: 3.6
os: macOS-latest
- python-version: 3.6
os: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
if: ${{ matrix.python-version != '3.13-dev' }}
with:
python-version: ${{ matrix.python-version }}
# use deadsnakes/action until actions/setup-python supports Python 3.13
- name: Set up development Python ${{ matrix.python-version }}
uses: deadsnakes/[email protected]
if: ${{ matrix.python-version == '3.13-dev' }}
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip --version
pip install -U setuptools
pip install pytest
pip install "sseclient<0.0.23,>=0.0.18"
pip install mwparserfromhell
pip install "PyMySQL >= 0.9.3"
pip install coverage
python -c "import setuptools; print('setuptools:', setuptools.__version__)"
- name: Generate user files
run: |
python -Werror::UserWarning -m pwb generate_user_files -site:wikipedia:test -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
- name: doctest with pytest
timeout-minutes: 5
run: |
python pwb.py version
pytest --version
coverage run -m pytest pywikibot --doctest-modules --ignore-glob="*gui.py" --ignore-glob="*memento.py"
- name: Show coverage statistics
run: |
coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3