Added parameter to control if files are sorted before being passed to… #293
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: Continuous Integration | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ci-tests-${{ github.ref }}-1 | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, macos-13, windows-2022] | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10", ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Print Python Information | |
run: python -VV | |
- name: install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
- name: Install and configure Poetry | |
run: | | |
pip3 install -U poetry setuptools | |
poetry config virtualenvs.in-project true | |
- name: Set up cache | |
uses: actions/cache@v4 | |
id: cached-poetry-dependencies | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ runner.arch }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: Download pandoc | |
run: poetry run python setup_binary.py download_pandoc | |
- name: run tests | |
run: poetry run python tests.py | |
builder_pypandoc: | |
needs: [test] | |
runs-on: ubuntu-20.04 # Any OS is fine as this wheel is not OS dependent | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 # Build any 1 python version as this wheel is not version dependent | |
- name: Update dependencies | |
run: python -m pip install -U pip wheel setuptools | |
- name: Build wheel | |
run: python setup.py sdist bdist_wheel | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pypandoc-distributions | |
path: dist/ | |
builder_pypandoc_binary: | |
needs: [test] | |
strategy: | |
matrix: | |
os: [macos-14, windows-2022, ubuntu-22.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Remove pyproject and use setuptools | |
run: rm pyproject.toml | |
- name: Build binary Archive | |
uses: pypa/cibuildwheel@v2.16.5 | |
env: | |
CIBW_BEFORE_ALL: "python3 -m pip install --break-system-packages setuptools && mv setup_binary.py setup.py && python3 setup.py download_pandoc" | |
CIBW_BUILD: cp39-* # Build any 1 python version as this wheel is not version dependent | |
# We skip some variants because: | |
# - pandoc does not publish binaries for Linux 32bit | |
CIBW_ARCHS_LINUX: "auto64 aarch64" | |
CIBW_ARCHS_MACOS: "x86_64 arm64" | |
CIBW_ARCHS_WINDOWS: "AMD64" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pypandoc-binary-${{ matrix.os }}-distributions | |
path: wheelhouse/ | |
publisher_release: | |
needs: [builder_pypandoc, builder_pypandoc_binary] | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist/ | |
merge-multiple: true | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
publisher_latest: | |
needs: [builder_pypandoc, builder_pypandoc_binary] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist/ | |
merge-multiple: true | |
- name: Make release | |
uses: "marvinpinto/action-automatic-releases@v1.2.1" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
title: "Latest Development Version" | |
automatic_release_tag: "latest" | |
files: dist/* |