Skip to content

Commit 75d2c5f

Browse files
committed
MNT: Untangle CI workflow into separate jobs
1 parent 65459ea commit 75d2c5f

File tree

3 files changed

+55
-49
lines changed

3 files changed

+55
-49
lines changed

.github/actions/setup/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Default Checkout'
2+
description: 'checkout & setup'
3+
inputs:
4+
python-version:
5+
description: 'Python version'
6+
required: true
7+
default: '>=3'
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Set up Python ${{ matrix.python-version }}
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: ${{ inputs.python-version }}
15+
- uses: actions/cache@v4
16+
with:
17+
path: |
18+
~/.cache/pip
19+
~\AppData\Local\pip\Cache
20+
~/Library/Caches/pip
21+
key: ${{ runner.os }}-py${{ inputs.python-version }}

.github/workflows/ci.yml

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,54 @@ on:
55
schedule: [ cron: '12 2 6 * *' ]
66

77
jobs:
8-
build:
9-
name: Build
8+
test-matrix:
109
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: ./.github/actions/setup
13+
with:
14+
python-version: '>=3'
1115

12-
strategy:
13-
matrix:
14-
python-version: [3.11, '>=3']
15-
include:
16-
- python-version: 3.11
17-
test-type: lint
18-
- python-version: 3.11
19-
test-type: docs
16+
- run: pip install -U pip setuptools wheel && pip install -U .
17+
- run: time python -m unittest -v pdoc.test
2018

19+
lint-test-coverage:
20+
runs-on: ubuntu-latest
2121
steps:
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v5
22+
- uses: actions/checkout@v4
2423
with:
25-
python-version: ${{ matrix.python-version }}
26-
27-
- uses: actions/cache@v4
28-
name: Set up caches
24+
fetch-depth: 2 # For codecov
25+
- uses: ./.github/actions/setup
2926
with:
30-
path: ~/.cache/pip
31-
key: ${{ runner.os }}-py${{ matrix.python-version }}
27+
python-version: 3.11
3228

33-
- name: Checkout repo
34-
uses: actions/checkout@v4
35-
with:
36-
fetch-depth: 3
37-
- name: Fetch tags
38-
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
39-
40-
- name: Install dependencies
41-
run: |
42-
pip install -U pip setuptools wheel
43-
pip install -U .
29+
- run: pip install -U pip setuptools wheel && pip install -U .
4430

4531
- name: Install lint dependencies
46-
if: matrix.test-type == 'lint'
4732
run: |
4833
pip install flake8 coverage mypy types-Markdown
4934
sudo apt update && sudo apt-get install \
5035
texlive-xetex lmodern texlive-fonts-recommended # test_pdf_pandoc
5136
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
5237
53-
- name: Install docs dependencies
54-
if: matrix.test-type == 'docs'
55-
run: pip install -e .
38+
- run: find -name '*.md' | xargs .github/lint-markdown.sh
39+
- run: flake8
40+
- run: mypy -p pdoc
41+
- run: time coverage run -m unittest -v pdoc.test
42+
- run: bash <(curl -s https://codecov.io/bash)
43+
- run: coverage report
44+
- run: PDOC_TEST_PANDOC=1 time python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
5645

57-
- name: Test w/ Coverage, Lint
58-
if: matrix.test-type == 'lint'
59-
run: |
60-
find -name '*.md' | xargs .github/lint-markdown.sh
61-
flake8
62-
mypy -p pdoc
63-
time coverage run -m unittest -v pdoc.test
64-
PDOC_TEST_PANDOC=1 time catchsegv python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
65-
bash <(curl -s https://codecov.io/bash)
46+
docs:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: ./.github/actions/setup
51+
with:
52+
python-version: 3.11
6653

67-
- name: Test
68-
if: '! matrix.test-type'
69-
run: time python -m unittest -v pdoc.test
54+
- name: Fetch tags
55+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
7056

71-
- name: Test docs
72-
if: matrix.test-type == 'docs'
73-
run: time doc/build.sh
57+
- run: pip install -U pip setuptools wheel && pip install -e .
58+
- run: time doc/build.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pdoc
88
[![package downloads](https://img.shields.io/pypi/dm/pdoc3.svg?color=skyblue&style=for-the-badge)](https://pypi.org/project/pdoc3)
99
[![GitHub Sponsors](https://img.shields.io/github/sponsors/kernc?color=pink&style=for-the-badge)](https://github.com/sponsors/kernc)
1010

11-
Auto-generate API documentation for Python projects.
11+
Auto-generate API documentation for Python 3+ projects.
1212

1313
[**Project website**](https://pdoc3.github.io/pdoc/)
1414

0 commit comments

Comments
 (0)