-
Notifications
You must be signed in to change notification settings - Fork 51
70 lines (65 loc) · 2.13 KB
/
test.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
name: Run tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- os: macos-latest
python-version: "3.12"
env:
DEBUG_TEST_PYFLYBY: 1
ENVNAME: ${{matrix.os}}-${{matrix.python-version}}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and update Python dependencies on Python 3
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade "pexpect>=3.3" 'pytest<=8' rlipython 'ipykernel>=5.4.3' requests jupyter flaky 'notebook<6.1' wheel 'jupyter_console>=6.2' pytest-cov ipython coverage pytest-json-report
pip install -e .
- name: test release build
run: |
python setup.py sdist bdist_wheel
- name: compileall
run: |
python -We:invalid -m compileall -f -q lib/ etc/;
- name: pytest Mac OS
if: ${{ matrix.os == 'macos-latest'}}
# json report can't be installed on Py2, and make macos super slow.
run: |
python -m pytest -v --cov=pyflyby --cov-report=xml --doctest-modules --maxfail=3 lib tests
- name: pytest (not MacOS)
if: ${{ matrix.os != 'macos-latest' }}
run: |
python -m pytest -v --cov=pyflyby --cov-report=xml\
--doctest-modules\
--maxfail=3\
--json-report\
--json-report-file=report-${ENVNAME}.json\
lib tests
- uses: actions/upload-artifact@v3
name: upload pytest timing reports as json
with:
path: |
./report-*.json
- uses: codecov/codecov-action@v2
- name: Build docs
if: ${{ matrix.python-version == '3.11'}}
run: |
pip install sphinx sphinx_rtd_theme sphinx-autodoc-typehints
cd doc
make html
cd ..