Skip to content

Commit 6dda00b

Browse files
Add GitHub action to test PR on coredev.
This is a gitHub Action for testing a package PR on buildout.coredev. For now (May 2023) it is an experiment, but I think we need it. Reasons: 1. The robot tests on Jenkins are flaky/unstable, which most likely is due to several robot jobs running parallel on one node. 2. Python 3.10 is not working with the 'Python Shining Pandas' plugin we use on Jenkins. We had it running with a different script for a while, but these changes got lost. Should be restorable, but let's try GHA. One thing to watch out for, is that robot tests are not always reported as failures. On the one hand there is config for that on Jenkins: plone/jenkins.plone.org#297 On the other hand I see the same problem locally: #3537 TODO: put this in a reusable workflow in plone/.github: https://docs.github.com/en/actions/using-workflows/reusing-workflows But first we should see if it actually works. Aftwerwards, we could install it in all relevant Plone repos using https://github.com/asottile/all-repos But nothing too hasty. :-)
1 parent 28f5294 commit 6dda00b

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/coredev.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This is a gitHub Action for testing a package PR on buildout.coredev.
2+
# For now (May 2023) it is an experiment, but I think we need it.
3+
# Reasons:
4+
# 1. The robot tests on Jenkins are flaky/unstable, which most likely is due
5+
# to several robot jobs running parallel on one node.
6+
# 2. Python 3.10 is not working with the 'Python Shining Pandas' plugin we use
7+
# on Jenkins. We had it running with a different script for a while, but
8+
# these changes got lost. Should be restorable, but let's try GHA.
9+
#
10+
# One thing to watch out for, is that robot tests are not always reported as failures.
11+
# On the one hand there is config for that on Jenkins:
12+
# https://github.com/plone/jenkins.plone.org/issues/297
13+
# On the other hand I see the same problem locally:
14+
# https://github.com/plone/Products.CMFPlone/issues/3537
15+
16+
# TODO: put this in a reusable workflow in plone/.github:
17+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
18+
19+
name: Test PR branch on buildout.coredev.
20+
on: pull_request
21+
jobs:
22+
build:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
python-version: ["3.7", "3.8", "3.9", "3.10"]
27+
test-command: ["bin/test --all -m test_robot"]
28+
include:
29+
- python-version: "3.10"
30+
test-command: "bin/test"
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Ubuntu setup
34+
run: |
35+
# needed for CMFPlone testUnicodeSplitter test:
36+
sudo locale-gen nl_NL@euro
37+
sudo update-locale
38+
# Needed for Products.PortalTransforms WordTransformsTest:
39+
sudo apt-get install -y wv
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v3
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
# cache: 'pip' would fail because we have no requirements.txt
45+
- name: "Install Python dependencies (pip)"
46+
uses: "py-actions/py-dependency-install@v3"
47+
with:
48+
path: "https://raw.githubusercontent.com/plone/buildout.coredev/6.0/requirements.txt"
49+
- name: Cache eggs
50+
uses: actions/cache@v3
51+
with:
52+
path: eggs
53+
key: eggs-${{ matrix.python-version }}-${{ runner.os }}-
54+
restore-keys: |
55+
eggs-${{ matrix.python-version }}-
56+
- name: Run buildout
57+
env:
58+
package_name: ${{ github.event.repository.name }}
59+
clone_url: ${{ github.event.pull_request.head.repo.clone_url }}
60+
branch: ${{ github.event.pull_request.head.ref }}
61+
run: |
62+
echo "Using environment: package_name=$package_name clone_url=$clone_url branch=$branch"
63+
# Create empty buildout.cfg, otherwise buildout gets confused.
64+
touch buildout.cfg
65+
buildout buildout:extends=https://raw.githubusercontent.com/plone/buildout.coredev/6.0/buildout.cfg buildout:git-clone-depth=1 buildout:auto-checkout+=$package_name sources:$package_name="git $clone_url branch=$branch" install instance test
66+
- name: Run tests
67+
env:
68+
ROBOT_BROWSER: headlesschrome
69+
run: ${{ matrix.test-command }}
70+
- name: Upload parts/tests directory for debugging
71+
uses: actions/upload-artifact@v2
72+
if: failure()
73+
with:
74+
name: plone-coredev-${{ matrix.python-version }}
75+
path: parts/test/

0 commit comments

Comments
 (0)