Update Python version support. #398
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
# Generated from: | |
# https://github.com/zopefoundation/meta/tree/master/config/zope-product | |
name: tests | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 12 * * 0' # run once a week on Sunday | |
# Allow to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
# We want to see all failures: | |
fail-fast: false | |
matrix: | |
os: | |
- ["ubuntu", "ubuntu-latest"] | |
config: | |
# [Python version, tox env] | |
- ["3.11", "release-check"] | |
- ["3.8", "py38"] | |
- ["3.9", "py39"] | |
- ["3.10", "py310"] | |
- ["3.11", "py311"] | |
- ["3.12", "py312"] | |
- ["3.13", "py313"] | |
- ["3.11", "coverage"] | |
runs-on: ${{ matrix.os[1] }} | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
name: ${{ matrix.config[1] }} | |
steps: | |
- name: "Configure PostgreSQL" | |
run: | | |
sudo mkdir -p /usr/local/pgsql/data | |
sudo chown postgres /usr/local/pgsql/data | |
sudo su - postgres -c '/usr/lib/postgresql/14/bin/initdb -D /usr/local/pgsql/data' | |
sudo su - postgres -c 'echo "max_prepared_transactions=10" >> /usr/local/pgsql/data/postgresql.conf' | |
sudo su - postgres -c 'cat /usr/local/pgsql/data/postgresql.conf' | |
sudo su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' | |
sudo su - postgres -c '/usr/lib/postgresql/14/bin/createdb zope_sqlalchemy_tests' | |
sudo su - postgres -c '/usr/lib/postgresql/14/bin/psql -l' | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.config[0] }} | |
allow-prereleases: true | |
- name: Pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.config[0] }}- | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Test | |
if: ${{ !startsWith(runner.os, 'Mac') }} | |
run: | | |
tox -f ${{ matrix.config[1] }} | |
- name: Test (macOS) | |
if: ${{ startsWith(runner.os, 'Mac') }} | |
run: tox -e ${{ matrix.config[1] }}-universal2 | |
- name: Coverage | |
if: matrix.config[1] == 'coverage' | |
run: | | |
pip install coveralls | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |