Merge pull request #2257 from Kozea/html5 #1163
This file contains 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: WeasyPrint's samples tests | |
on: [push, pull_request] | |
env: | |
REPORTS_FOLDER: 'report' | |
jobs: | |
samples: | |
name: Generate samples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip and setuptools | |
run: python -m pip install --upgrade pip setuptools | |
- name: Install requirements | |
run: python -m pip install . | |
- name: Clone samples repository | |
run: git clone https://github.com/CourtBouillon/weasyprint-samples.git | |
- name: Create output folder | |
run: mkdir ${{env.REPORTS_FOLDER}} | |
- name: Book classical | |
run: python -m weasyprint weasyprint-samples/book/book.html -s weasyprint-samples/book/book-classical.css ${{env.REPORTS_FOLDER}}/book-classical.pdf | |
- name: Book fancy | |
run: python -m weasyprint weasyprint-samples/book/book.html -s weasyprint-samples/book/book.css ${{env.REPORTS_FOLDER}}/book-fancy.pdf | |
- name: Invoice | |
run: python -m weasyprint weasyprint-samples/invoice/invoice.html ${{env.REPORTS_FOLDER}}/invoice.pdf | |
- name: Letter | |
run: python -m weasyprint weasyprint-samples/letter/letter.html ${{env.REPORTS_FOLDER}}/letter.pdf | |
- name: Poster | |
run: python -m weasyprint weasyprint-samples/poster/poster.html -s weasyprint-samples/poster/poster.css ${{env.REPORTS_FOLDER}}/poster.pdf | |
- name: Flyer | |
run: python -m weasyprint weasyprint-samples/poster/poster.html -s weasyprint-samples/poster/flyer.css ${{env.REPORTS_FOLDER}}/flyer.pdf | |
- name: Report | |
run: python -m weasyprint weasyprint-samples/report/report.html ${{env.REPORTS_FOLDER}}/report.pdf | |
- name: Ticket | |
run: python -m weasyprint weasyprint-samples/ticket/ticket.html ${{env.REPORTS_FOLDER}}/ticket.pdf | |
- name: Archive generated PDFs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: generated-documents | |
path: ${{env.REPORTS_FOLDER}} | |
retention-days: 1 |