-
-
Notifications
You must be signed in to change notification settings - Fork 148
73 lines (62 loc) · 2.15 KB
/
ci.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
name: CI
on:
push: { branches: [master] }
pull_request: { branches: [master] }
schedule: [ cron: '12 2 * * 6' ] # Every Saturday, 02:12
jobs:
build:
name: Build
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.7, 3.8, '3.10']
include:
- python-version: 3.9
test-type: lint
- python-version: 3.9
test-type: docs
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
name: Set up caches
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 3
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U .
- name: Install lint dependencies
if: matrix.test-type == 'lint'
run: |
pip install flake8 coverage mypy types-Markdown
sudo apt update && sudo apt-get install \
texlive-xetex lmodern texlive-fonts-recommended # test_pdf_pandoc
wget -O/tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/2.10/pandoc-2.10-1-amd64.deb && sudo dpkg -i /tmp/pandoc.deb
- name: Install docs dependencies
if: matrix.test-type == 'docs'
run: pip install -e .
- name: Test w/ Coverage, Lint
if: matrix.test-type == 'lint'
run: |
find -name '*.md' | xargs .github/lint-markdown.sh
flake8
mypy -p pdoc
time coverage run -m unittest -v pdoc.test
PDOC_TEST_PANDOC=1 time catchsegv python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
bash <(curl -s https://codecov.io/bash)
- name: Test
if: '! matrix.test-type'
run: time python -m unittest -v pdoc.test
- name: Test docs
if: matrix.test-type == 'docs'
run: time doc/build.sh