-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.47 KB
/
ci.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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: ci
on:
push:
branches:
- "main"
- "!releases/**"
pull_request:
branches:
- "main"
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
plone-version:
- "Plone52"
python-version:
- 3.7
- 3.8
# - 3.9
steps:
- name: checkout
uses: actions/checkout@v2
- name: cache pip and buildout
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/buildout-cache
~/extends
key: ${{ matrix.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/tox.ini') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get install libxml2-dev libxslt1-dev libjpeg-dev
- name: Set up buildout cache
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 Python dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check Python versions
run: |
python --version
python3 --version
- name: Lint and test Plone package with tox
run: tox -r
env:
PLONE-VERSION: ${{ matrix.plone-version }}
PYTHON-VERSION: ${{ matrix.python-version }}
- name: Coverage report on python3.7
run: tox -r -e coverage-report
if: matrix.python-version == '3.7'
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v1"
with:
fail_ci_if_error: true
if: matrix.python-version == '3.7'