pyladoc/.github/workflows/ci.yml

99 lines
2.3 KiB
YAML

name: CI Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", 3.13]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install LaTeX
run: sudo apt-get install -y texlive-latex-extra texlive-fonts-recommended lmodern texlive-xetex texlive-science
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Lint code with flake8
run: flake8
- name: Type checking with mypy
run: mypy
- name: Run tests with pytest
run: pytest
- name: Upload rendered files
uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: rendering-results-ubuntu
path: tests/out/test_*_render*
build-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install LaTeX
run: choco install miktex
- name: Check directory structure of MiKTeX installation
run: |
dir "C:\Program Files\MiKTeX\miktex\bin\x64\*"
- name: Add miktex to PATH
run: |
echo "PATH=$PATH;C:\Program Files\MiKTeX\miktex\bin\x64" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Show path variable
run: |
echo $env:PATH
echo "-----"
echo $env:GITHUB_ENV
- name: test xelatex
run: xelatex --version
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Run tests with pytest
run: pytest
- name: Upload rendered files
uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: rendering-results-windows
path: tests/out/test_*_render*.pdf