CI: Cache APT and pandoc download #389
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: { branches: [master] } | |
pull_request: { branches: [master] } | |
schedule: [ cron: '12 2 6 * *' ] | |
jobs: | |
test-matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '>=3'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install -U pip setuptools wheel && pip install -U . | |
- run: time python -m unittest -v pdoc.test | |
lint-test-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
python-version: 3.11 | |
- run: pip install -U pip setuptools wheel && pip install -U . | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2 | |
with: | |
path: /tmp/pandoc.deb | |
key: pandoc | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2 | |
with: | |
path: /var/cache/apt/archives/*.deb | |
key: apt-cache | |
- run: pip install flake8 coverage mypy types-Markdown | |
- run: sudo apt update && sudo apt-get install \ | |
texlive-xetex lmodern texlive-fonts-recommended # test_pdf_pandoc | |
- run: wget --no-clobber -O/tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-amd64.deb | |
- run: sudo dpkg -i /tmp/pandoc.deb | |
- run: find -name '*.md' | xargs .github/lint-markdown.sh | |
- run: flake8 pdoc setup.py | |
- run: mypy -p pdoc | |
- run: time coverage run -m unittest -v pdoc.test | |
- run: coverage report | |
- run: PDOC_TEST_PANDOC=1 time python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Pdoc Documentation.pdf | |
path: /tmp/pdoc.pdf | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
python-version: 3.11 | |
- name: Fetch tags | |
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- run: pip install -U pip setuptools wheel && pip install -e . | |
- run: time doc/build.sh |