-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.48 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
---
name: Automated Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}
jobs:
tests:
name: Python tests
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: "ubuntu-20.04"
python-version: "3.6"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tests dependencies
run: |
sudo apt-get install -y build-essential libcairo2-dev libgirepository1.0-dev libpango1.0-dev
python -m pip install --upgrade pip
- name: Install application with its dependencies
if: ${{ matrix.python-version != '3.6' }}
run: |
pip install . .[web] .[tests]
# Unfortunately, pip and setuptools in Python 3.6 do not fully support
# PEP517 pyproject.toml. As a workaround for this version, the setup.py
# script provided by RFL.build package is copied and executed.
#
# Some dependencies are pre-installed to add version constraints, in order
# to force installation of old versions compatible with Python 3.6.
#
# Some RacksDB optional dependencies are declared in extra packages.
# This is not supported by setup.py script from RFL.build. As a workaround
# these dependencies are installed manually afterwhile.
- name: Install application with its dependencies (Python 3.6)
if: ${{ matrix.python-version == '3.6' }}
run: |
echo "::notice::Installing RFL.build"
pip install RFL.build
echo "::notice::Installing PyYAML (old version)"
pip install PyYAML==5.4.1
echo "::notice::Installing PyGObject (old version)"
pip install "PyGObject<3.43.0"
cp -v ${Python3_ROOT_DIR}/lib/python3.6/site-packages/rfl/build/scripts/setup setup.py
python3 setup.py install
echo "::notice::Installing optional dependencies required for tests"
pip install pytest
# The cached_property decorator is integrated in Python 3.8+. For older versions,
# install cached_property external library.
- if: ${{ matrix.python-version == '3.6' || matrix.python-version == '3.7' }}
run: pip install cached_property
- name: Run tests
run: pytest