-
Notifications
You must be signed in to change notification settings - Fork 53
146 lines (140 loc) · 6.02 KB
/
functional_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
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
name: Functional tests
on:
pull_request:
paths:
- ".github/workflows/functional_tests.yml"
- "nxdrive/**/*.py"
- "tests/*.py"
- "tests/functional/*.py"
- "tools/deps/*.txt"
push:
branches: [master]
paths:
- "nxdrive/**/*.py"
- "tests/*.py"
- "tests/functional/*.py"
env:
NXDRIVE_TEST_NUXEO_URL: https://drive-2021.beta.nuxeocloud.com/nuxeo
NXDRIVE_TEST_USERNAME: ${{ secrets.NXDRIVE_TEST_USERNAME }}
NXDRIVE_TEST_PASSWORD: ${{ secrets.NXDRIVE_TEST_PASSWORD }}
jobs:
functional-tests-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- uses: actions/cache@v4
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install system dependencies
run: |
sudo apt install xclip
Xvfb :99 -screen 0 1920x1080x24+32 &
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Functional tests
run: tox -e ft
env:
DISPLAY: ":99"
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.xml
flags: functional
env_vars: OS,PYTHON
functional-tests-macos:
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- uses: actions/cache@v4
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Functional tests
run: tox -e ft
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.xml
flags: functional
env_vars: OS,PYTHON
functional-tests-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v4
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
# Cannot be used for now: OSError: [WinError 193] %1 is not a valid Win32 application
# - uses: actions/cache@v4
# with:
# path: .tox
# key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
# restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements.txt', 'tools/deps/requirements-test.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Functional tests
run: tox -e ft
- name: Upload coverage to Codecov
if: ${{ success() }} || ${{ failure() }}
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.xml
flags: functional
env_vars: OS,PYTHON
cleanup:
runs-on: ubuntu-latest
if: always()
needs:
- functional-tests-linux
- functional-tests-macos
- functional-tests-windows
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9 # XXX_PYTHON
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-clean.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('tools/deps/requirements-clean.txt', 'tools/deps/requirements-tox.txt') }}
- uses: actions/cache@v4
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-clean.txt', 'tools/deps/requirements-tox.txt') }}
restore-keys: ${{ runner.os }}-tox-${{ hashFiles('tools/deps/requirements-clean.txt', 'tools/deps/requirements-tox.txt') }}
- name: Install tox
run: python -m pip install -r tools/deps/requirements-tox.txt
- name: Clean-up tests data
run: tox -e clean