Skip to content

Update draft-pdf.yml #107

Update draft-pdf.yml

Update draft-pdf.yml #107

Workflow file for this run

# .github/workflows/ci.yml
name: Python Package CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
# Don't cancel other jobs if one version fails
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
# Create a new cache only if pyproject.toml changes
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg xvfb
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# Install flake8 for linting, then install the package with its test extras
pip install flake8
pip install -e .[test]
- name: Lint with flake8
run: |
# Lint the package source in the 'src' directory and any top-level tests folder
# Stop the build if there are Python syntax errors or undefined names
flake8 src/conezen tests --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings.
flake8 src/conezen tests --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Test with pytest
run: |
# Run tests within the virtual framebuffer environment to handle plotting
xvfb-run pytest