Skip to content

Add python 3.11, 3.12; fix Github actions workflow #33

Add python 3.11, 3.12; fix Github actions workflow

Add python 3.11, 3.12; fix Github actions workflow #33

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Plone package
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
plone-version: ['Plone52', 'Plone60']
# While tox skips invalid matrix combinations, Github actions does
# schedule and fail jobs for these. So exclude them. We could also
# use include instead, but then the job names do not contain the
# Plone version.
exclude:
- python-version: '3.8'
plone-version: 'Plone60'
- python-version: '3.9'
plone-version: 'Plone52'
- python-version: '3.10'
plone-version: 'Plone52'
- python-version: '3.11'
plone-version: 'Plone52'
- python-version: '3.12'
plone-version: 'Plone52'
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache hash ${{ matrix.python-version }} - ${{ matrix.plone-version }}
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/buildout-cache
~/extends
key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/*.cfg') }}-${{ hashFiles('**/constraints.txt') }}-${{ hashFiles('**/tox.ini') }}
#restore-keys: |
# ${{ runner.os }}-tox-
- name: Cache configure
run: |
mkdir -p ~/buildout-cache/{eggs,downloads}
mkdir ~/.buildout
echo "[buildout]" > $HOME/.buildout/default.cfg
echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Black-Check
run: |
tox -r -e black-check
- name: Lint with tox
run: |
tox -r
env:
MATCH_ACTION_ENV: lint
- name: Test with tox
run: |
tox -r
env:
MATCH_ACTION_ENV: ${{ matrix.plone-version }}
# To add coverage, see https://hynek.me/articles/ditch-codecov-python/