ci: upgrade actions #247
This file contains hidden or 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/ | |
| # | |
| name: CI | |
| on: | |
| pull_request: {} | |
| jobs: | |
| check: | |
| name: "Check" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| test: | |
| - {PY: "3.14", TOXENV: "lint"} | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: "Setup Python ${{matrix.test.PY}}" | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{matrix.test.PY}} | |
| pip-install: -r etc/requirements.build.txt | |
| - 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.10", TOXENV: "py310", arch: "x64"} | |
| - {os: "ubuntu-latest", osname: "Linux", PY: "3.13", TOXENV: "py313", arch: "x64"} | |
| - {os: "ubuntu-latest", osname: "Linux", PY: "3.14", TOXENV: "py314", arch: "x64"} | |
| - {os: "macos-latest", osname: "MacOS", PY: "3.12", TOXENV: "py312", arch: "x64"} | |
| - {os: "macos-latest", osname: "MacOS", PY: "3.14", TOXENV: "py314", arch: "arm64"} | |
| - {os: "windows-latest", osname: "Windows", PY: "3.13", TOXENV: "py313", arch: "x64"} | |
| - {os: "windows-latest", osname: "Windows", PY: "3.14", TOXENV: "py314", arch: "x64"} | |
| #- {os: "ubuntu-latest", osname: "Linux", PY: "pypy3.11", TOXENV: "pypy311", arch: "x64"} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: "Setup Python ${{matrix.test.PY}}" | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{matrix.test.PY}} | |
| architecture: ${{matrix.test.arch}} | |
| allow-prereleases: true | |
| pip-install: -r etc/requirements.build.txt | |
| - name: "Build" | |
| run: python setup.py build | |
| - name: "Test" | |
| env: | |
| TOXENV: ${{matrix.test.TOXENV}} | |
| run: python -m tox -r -- --color=yes | |
| database: | |
| name: "Python ${{matrix.test.PY}} + PostgreSQL ${{matrix.test.PG}}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| test: | |
| - {PY: "3.10", PG: "16", TOXENV: "py310"} | |
| - {PY: "3.14", PG: "18", TOXENV: "py314"} | |
| #- {PY: "pypy3.9", PG: "15", TOXENV: "pypy39"} | |
| #- {PY: "pypy3.10", PG: "15", TOXENV: "pypy310"} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: "Setup Python ${{matrix.test.PY}}" | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{matrix.test.PY}} | |
| pip-install: -r etc/requirements.build.txt | |
| - 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 -nH 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: | | |
| python3 -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}} [${{matrix.sys.archs}}]" | |
| runs-on: ${{matrix.sys.os}} | |
| strategy: | |
| matrix: | |
| sys: | |
| - {os: "ubuntu-latest", name: "Linux", archs: "auto"} | |
| - {os: "ubuntu-24.04-arm", name: "Linux", archs: "aarch64"} | |
| - {os: "macos-15-intel", name: "MacOS", archs: "x86_64 universal2"} | |
| - {os: "macos-latest", name: "MacOS", archs: "auto"} | |
| - {os: "windows-latest", name: "Windows", archs: "auto"} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 | |
| env: | |
| CIBW_ARCHS: "${{matrix.sys.archs}}" | |
| - name: "Check" | |
| shell: bash | |
| run: | | |
| ls -l wheelhouse | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: {name: "wheel-${{matrix.sys.os}}", path: "wheelhouse"} | |