-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (65 loc) · 2.14 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: tests
on:
push:
branches: [ main ]
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
# [Python version, tox env]
- ["2.7", "plone43-py27"]
- ["2.7", "plone50-py27"]
- ["2.7", "plone51-py27"]
- ["2.7", "plone52-py27"]
- ["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
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Install lxml dev libraries
# Needed to avoid error on Plone 5.0.
# Error: Please make sure the libxml2 and libxslt development packages are installed.
run: sudo apt-get install libxml2-dev libxslt1-dev
if: matrix.config[1] == 'plone50-py27'
- 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: Test
run: tox -e ${{ matrix.config[1] }}