-
Notifications
You must be signed in to change notification settings - Fork 7
149 lines (144 loc) · 4.99 KB
/
main.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches-ignore:
- "master"
- "releases/**"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plone-version:
- '5.0'
- '5.1'
- '5.2'
python-version: ['2.7']
layer:
- Portlet_AjaxDisabled
- Portlet_AjaxEnabled
- Tile
coverage: ['no_coverage']
include:
- plone-version: 5.2
python-version: 3.6
layer: Tile
coverage: coverage
- plone-version: 5.2
python-version: 3.7
layer: Portlet_AjaxDisabled
coverage: coverage
- plone-version: 5.2
python-version: 3.8
layer: Portlet_AjaxEnabled
coverage: coverage
- plone-version: 5.2
python-version: 3.8
layer: Portlet_AjaxEnabled
exclude:
- plone-version: 5.0
layer: Tile # standardtiles 2.3.2 does support using the request to query. embed might still be possible
- plone-version: 5.0
layer: Portlet_AjaxEnabled # passes but meaningless as it skips all the tests
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -y
# sudo apt-get install -y build-essentials
sudo apt-get install -y libxml2-dev libxslt-dev python-dev
# sudo apt-get install py-pip
pip install \
virtualenv wheel
- uses: nanasess/setup-chromedriver@master
# with:
# # Optional: do not specify to match Chrome's version
# chromedriver-version: '77.0.3865.40'
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/buildout-cache
~/extends
~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/*.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.plone-version }}-
${{ runner.os }}-${{ matrix.python-version }}-
${{ runner.os }}-
- name: setup 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: bootstrap buildout
run: |
./bootstrap.sh test-${{ matrix.plone-version }}.x.cfg
ls -al
- name: buildout
run: |
bin/buildout -t 10 -Nc test-${{ matrix.plone-version }}.x.cfg
bin/pip install zest.pocompile
bin/pocompile src
- name: test
if: ${{ matrix.coverage != 'coverage' }}
run: |
export DISPLAY=:99.0
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
sleep 3
bin/test --all --layer ${{ matrix.layer }}
- name: createcoverage
if: ${{ matrix.coverage == 'coverage' }}
run: |
export DISPLAY=:99.0
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
sleep 3
bin/createcoverage -t '--all --layer ${{ matrix.layer }}'
bin/coverage json -i
- name: Coveralls
if: ${{ matrix.coverage == 'coverage' }}
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: ${{ matrix.plone-version }}-${{ matrix.python-version }}-${{ matrix.layer }}
- name: code-analysis
if: always()
run: echo "${{ matrix.plone-version }}" | grep 5.1 || bin/code-analysis
- name: black
if: ${{ matrix.python-version == '3.8' }}
run: |
pip install black
black --check src
- name: Artifact Robot Test Report
if: failure()
uses: actions/upload-artifact@v1
with:
name: test_results-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ matrix.layer }}
path: ./parts/test
- uses: actions/setup-python@v2
if: failure()
with:
python-version: 2.7
- name: Robottest report
continue-on-error: true
if: failure()
run: |
pip2.7 install popt || pip2.7 install --user popt
grep --include=output.xml -Rl FAIL parts/test | xargs --no-run-if-empty -n 1 popt
coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true