doc #192
Workflow file for this run
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
# | |
# https://docs.github.com/en/actions/reference | |
# https://github.com/actions | |
# https://cibuildwheel.readthedocs.io/en/stable/options/ | |
# | |
# uses: https://github.com/actions/checkout @v3 | |
# uses: https://github.com/actions/setup-python @v4 | |
# uses: https://github.com/actions/download-artifact @v3 | |
# uses: https://github.com/actions/upload-artifact @v3 | |
# uses: https://github.com/pypa/cibuildwheel @v2.15 | |
name: CI | |
on: | |
pull_request: {} | |
push: {} | |
jobs: | |
check: | |
name: "Check" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test: | |
- {PY: "3.11", TOXENV: "lint"} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Python ${{matrix.test.PY}}" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.test.PY}} | |
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check | |
- name: "Test" | |
env: | |
TOXENV: ${{matrix.test.TOXENV}} | |
run: python3 -m tox -r | |
no_database: | |
name: "${{matrix.test.osname}} + Python ${{matrix.test.PY}} ${{matrix.test.arch}}" | |
runs-on: ${{matrix.test.os}} | |
strategy: | |
matrix: | |
test: | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.7", TOXENV: "py37", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.8", TOXENV: "py38", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.9", TOXENV: "py39", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.10", TOXENV: "py310", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.11", TOXENV: "py311", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "3.12", TOXENV: "py312", arch: "x64"} | |
- {os: "macos-latest", osname: "MacOS", PY: "3.10", TOXENV: "py310", arch: "x64"} | |
- {os: "macos-latest", osname: "MacOS", PY: "3.11", TOXENV: "py311", arch: "x64"} | |
#- {os: "macos-latest", osname: "MacOS", PY: "3.12", TOXENV: "py312", arch: "x64"} | |
- {os: "windows-latest", osname: "Windows", PY: "3.10", TOXENV: "py310", arch: "x64"} | |
- {os: "windows-latest", osname: "Windows", PY: "3.11", TOXENV: "py311", arch: "x64"} | |
#- {os: "windows-latest", osname: "Windows", PY: "3.12", TOXENV: "py312", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy-3.8", TOXENV: "pypy38", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy-3.9", TOXENV: "pypy39", arch: "x64"} | |
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy-3.10", TOXENV: "pypy310", arch: "x64"} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Python ${{matrix.test.PY}}" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.test.PY}} | |
architecture: ${{matrix.test.arch}} | |
allow-prereleases: true | |
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check | |
- name: "Build" | |
run: python setup.py build | |
- name: "Test" | |
env: | |
TOXENV: ${{matrix.test.TOXENV}} | |
run: python -m tox -r -- --color=yes | |
database: | |
#if: false | |
#name: "database test (disabled)" | |
name: "PostgreSQL ${{matrix.test.PG}} + Python ${{matrix.test.PY}}" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test: | |
- {PY: "3.10", PG: "14", TOXENV: "py310"} | |
- {PY: "3.11", PG: "15", TOXENV: "py311"} | |
#- {PY: "pypy3.9", PG: "15", TOXENV: "pypy39"} | |
#- {PY: "pypy3.10", PG: "15", TOXENV: "pypy310"} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Python ${{matrix.test.PY}}" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.test.PY}} | |
- name: "Install tox" | |
run: | | |
python -m pip -q install tox | |
- name: "InstallDB" | |
run: | | |
echo "::group::apt-get-update" | |
sudo -nH apt-get -q update | |
sudo -nH apt-get -q install curl ca-certificates gnupg | |
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc \ | |
| gpg --dearmor \ | |
| sudo -nH tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.test.PG}}" \ | |
| sudo tee /etc/apt/sources.list.d/pgdg.list | |
sudo -nH apt-get -q update | |
echo "::endgroup::" | |
echo "::group::apt-get-install" | |
# disable new cluster creation | |
sudo -nH mkdir -p /etc/postgresql-common/createcluster.d | |
echo "create_main_cluster = false" | sudo -nH tee /etc/postgresql-common/createcluster.d/no-main.conf | |
sudo -nH apt-get -qyu install postgresql-${{matrix.test.PG}} | |
echo "::endgroup::" | |
# tune environment | |
echo "/usr/lib/postgresql/${{matrix.test.PG}}/bin" >> $GITHUB_PATH | |
echo "PGHOST=/tmp" >> $GITHUB_ENV | |
- name: "StartDB" | |
run: | | |
rm -rf data log | |
mkdir -p log | |
LANG=C initdb data | |
sed -ri -e "s,^[# ]*(unix_socket_directories).*,\\1='/tmp'," data/postgresql.conf | |
pg_ctl -D data -l log/pg.log start || { cat log/pg.log ; exit 1; } | |
sleep 1 | |
createdb testdb | |
- name: "Test" | |
env: | |
TOXENV: ${{matrix.test.TOXENV}} | |
TEST_DB: dbname=testdb host=/tmp | |
run: | | |
python -m tox -r -- --color=yes | |
- name: "StopDB" | |
run: | | |
pg_ctl -D data stop | |
rm -rf data log /tmp/.s.PGSQL* | |
cibuildwheel: | |
name: "Wheels: ${{matrix.sys.name}}" | |
runs-on: ${{matrix.sys.os}} | |
strategy: | |
matrix: | |
sys: | |
- {os: "ubuntu-latest", name: "Linux"} | |
- {os: "macos-latest", name: "MacOS"} | |
- {os: "windows-latest", name: "Windows"} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Set up QEMU" | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- uses: pypa/cibuildwheel@v2.15 | |
env: | |
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | |
CIBW_ARCHS_WINDOWS: "auto" | |
CIBW_ARCHS_LINUX: "auto aarch64" | |
# cp38: cp37-macos does not support universal2/arm64 | |
CIBW_BUILD: "cp38-* pp*-manylinux_x86_64" | |
CIBW_SKIP: "pp37-*" | |
- name: "Check" | |
shell: bash | |
run: | | |
ls -l wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: {name: "dist", path: "wheelhouse"} | |