Skip to content

Commit

Permalink
Fix GHA for 2.7
Browse files Browse the repository at this point in the history
Improve by using tox
  • Loading branch information
gotcha committed Oct 19, 2023
1 parent b229fef commit 79de40c
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 113 deletions.
96 changes: 54 additions & 42 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,60 @@
on: [push, pull_request]
name: Tests
jobs:
instance:
# instance:
# strategy:
# fail-fast: false
# matrix:
# include:
# - python-version: "2.7"
# plone-version: "5.2"
# os: "ubuntu-20.04"
# - python-version: "3.8"
# plone-version: "5.2"
# os: "ubuntu-latest"
# - python-version: "3.9"
# plone-version: "6.0"
# os: "ubuntu-latest"
# runs-on: ${{ matrix.os }}
# name: ${{ matrix.plone-version }}-${{ matrix.python-version }} start instance
# steps:
# - uses: actions/checkout@v3.3.0
# - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# python-version: ${{ matrix.python-version }}
# plone-version: ${{ matrix.plone-version }}
# buildout-parts: "copy_ckeditor_code ckeditor instance"
# - name: Check that instance starts
# run: |
# bin/instance run startup.py
all_tests_27:
strategy:
fail-fast: false
matrix:
include:
- python-version: "2.7"
plone-version: "5.2"
os: "ubuntu-20.04"
- python-version: "3.8"
plone-version: "5.2"
os: "ubuntu-latest"
- python-version: "3.9"
plone-version: "6.0"
os: "ubuntu-latest"
runs-on: ${{ matrix.os }}
name: ${{ matrix.plone-version }}-${{ matrix.python-version }} start instance
config:
- ["plone52-py27", "plone/test-with-tox:5.2-2.7"]
# needs: instance
runs-on: ubuntu-20.04
container:
image: ${{ matrix.config[1] }}
name: ${{ matrix.config[0] }}
steps:
- uses: actions/checkout@v3.3.0
- uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
python-version: ${{ matrix.python-version }}
plone-version: ${{ matrix.plone-version }}
buildout-parts: "copy_ckeditor_code ckeditor instance"
- name: Check that instance starts
run: |
bin/instance run startup.py
- uses: actions/checkout@v3
- name: Test
run: tox -e ${{ matrix.config[0] }}
all_tests:
strategy:
fail-fast: false
matrix:
include:
- python-version: "2.7"
plone-version: "5.2"
os: "ubuntu-20.04"
- python-version: "3.8"
plone-version: "5.2"
os: "ubuntu-latest"
- python-version: "3.9"
plone-version: "6.0"
os: "ubuntu-latest"
needs: instance
# needs: instance
name: ${{ matrix.plone-version }}-${{ matrix.python-version }} run tests (robot inc)
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -69,18 +81,18 @@ jobs:
run: |
ROBOT_BROWSER=headlessFirefox bin/pytest -k "robot and not image2"
ROBOT_BROWSER=headlessFirefox bin/pytest -k "robot and image2"
test_upgrade:
needs: all_tests
name: 5.2-2.7 upgrade
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3.3.0
- uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action
with:
github-token: ${{ secrets.github-token }}
python-version: "2.7"
plone-version: "5.2"
buildout-parts: "copy_ckeditor_code ckeditor pytest"
- name: Run upgrade tests
run: |
bin/pytest -k "upgrade"
# test_upgrade:
# needs: all_tests
# name: 5.2-2.7 upgrade
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3.3.0
# - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action
# with:
# github-token: ${{ secrets.github-token }}
# python-version: "2.7"
# plone-version: "5.2"
# buildout-parts: "copy_ckeditor_code ckeditor pytest"
# - name: Run upgrade tests
# run: |
# bin/pytest -k "upgrade"
5 changes: 5 additions & 0 deletions requirements-tox.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# For Buildout related packages, it is easiest to keep them at the same version for all environments.
# Keep these in sync with base.cfg please:
zc.buildout==3.0.1
# setuptools 67 is too strict with versions
setuptools<67
18 changes: 0 additions & 18 deletions test-4.3.x.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions test-5.0.x.cfg

This file was deleted.

35 changes: 0 additions & 35 deletions test-5.1.x.cfg

This file was deleted.

12 changes: 6 additions & 6 deletions test-6.0.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ eggs =
Plone
collective.ckeditor

[versions]
lxml = 4.7.1
six = 1.10.0
selenium = 4.8.0
Pillow = 9.4.0
wheel = 0.38.4
# [versions]
# lxml = 4.7.1
# six = 1.10.0
# selenium = 4.8.0
# Pillow = 9.4.0
# wheel = 0.38.4

[sources]
collective.plonefinder = git ${remotes:collective}/collective.plonefinder.git pushurl=${remotes:collective_push}/collective.plonefinder.git branch=plone5
Expand Down
17 changes: 17 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tox]
minversion = 3.18
envlist =
plone52-py{27,36,37,38}
plone60-py{38,39,310,311}

[testenv]
# We do not install with pip, but with buildout:
usedevelop = false
skip_install = true
deps =
-r requirements-tox.txt
commands_pre =
plone52: {envbindir}/buildout -Nc {toxinidir}/test-5.2.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install copy_ckeditor_code ckeditor pytest
plone60: {envbindir}/buildout -Nc {toxinidir}/test-6.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install copy_ckeditor_code ckeditor pytest
commands =
{envbindir}/pytest

0 comments on commit 79de40c

Please sign in to comment.