Skip to content

Commit

Permalink
toxify more
Browse files Browse the repository at this point in the history
  • Loading branch information
gotcha committed Oct 19, 2023
1 parent be4d155 commit 5eec4eb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 76 deletions.
127 changes: 51 additions & 76 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
on: [push, pull_request]
name: Tests
jobs:
# 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/[email protected]
# - 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:
config:
- ["plone52-py27", "plone/test-with-tox:5.2-2.7"]
# needs: instance
runs-on: ubuntu-20.04
container:
image: ${{ matrix.config[1] }}
Expand All @@ -47,52 +19,55 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.8"
plone-version: "5.2"
os: "ubuntu-latest"
- python-version: "3.9"
plone-version: "6.0"
os: "ubuntu-latest"
# needs: instance
name: ${{ matrix.plone-version }}-${{ matrix.python-version }} run tests (robot inc)
runs-on: ${{ matrix.os }}
config:
# [Python version, tox env]
- ["3.6", "plone52-py36"]
- ["3.7", "plone52-py37"]
- ["3.8", "plone52-py38"]
- ["3.8", "plone60-py38"]
- ["3.9", "plone60-py39"]
- ["3.10", "plone60-py310"]
- ["3.11", "plone60-py311"]
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- 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 pytest"
- name: Run unit tests
run: |
bin/pytest
- name: Install Firefox
uses: browser-actions/setup-firefox@latest
with:
firefox-version: "109.0"
- name: Install Geckodriver
uses: browser-actions/setup-geckodriver@latest
with:
geckodriver-version: "0.32.0"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run robot tests
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/[email protected]
# - 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"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
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: Prepare buildout egg cache
run: |
mkdir ~/.buildout
echo "[buildout]" >> ~/.buildout/default.cfg
echo "eggs-directory = ~/eggs" >> ~/.buildout/default.cfg
- name: Cache eggs
uses: actions/cache@v3
with:
path: ~/eggs
key: ${{ runner.os }}-eggs-${{ matrix.config[0] }}-${{ matrix.config[1] }}-${{ hashFiles('*cfg') }}
restore-keys: |
${{ runner.os }}-eggs-${{ matrix.config[0] }}-${{ matrix.config[1] }}-
${{ runner.os }}-eggs-${{ matrix.config[0] }}-
- name: Install Firefox
uses: browser-actions/setup-firefox@latest
with:
firefox-version: "109.0"
- name: Install Geckodriver
uses: browser-actions/setup-geckodriver@latest
with:
geckodriver-version: "0.32.0"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: tox -e ${{ matrix.config[1] }}
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ deps =
commands_pre =
plone52: {envbindir}/buildout -Nc {toxinidir}/test-5.2.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install instance copy_ckeditor_code ckeditor pytest
plone60: {envbindir}/buildout -Nc {toxinidir}/test-6.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install instance copy_ckeditor_code ckeditor pytest
setenv =
ROBOT_BROWSER=headlessFirefox
commands =
{envbindir}/instance run startup.py
{envbindir}/pytest
!py27: {envbindir}/pytest -k "robot and not image2"
!py27: {envbindir}/pytest -k "robot and image2"
py27: {envbindir}/pytest -k "upgrade"

0 comments on commit 5eec4eb

Please sign in to comment.