forked from bleachbit/bleachbit
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (124 loc) · 4.11 KB
/
Copy pathtest_ubuntu.yaml
File metadata and controls
137 lines (124 loc) · 4.11 KB
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
name: Run tests on Linux
on:
push:
branches:
- '**'
paths-ignore:
- 'bleachbit.spec'
- 'debian/**'
- 'doc/**'
- 'po/**'
- 'README.md'
- 'windows/**'
pull_request: # Run on all pull requests
paths-ignore:
- 'bleachbit.spec'
- 'debian/**'
- 'doc/**'
- 'po/**'
- 'README.md'
- 'windows/**'
# 2025-05-01: ubuntu-latest is currently 24.04, and its native
# python version is 3.12.
# native python for 22.04 is 3.10.
jobs:
test:
timeout-minutes: 25
strategy:
matrix:
python-version: ['3.9', '3.13', '3.14']
include:
- python-version: '3.9'
ubuntu-version: ubuntu-22.04
python-extra-dep: ''
pygobject-version: '<3.51.0'
test_timeout_minutes: 20
- python-version: '3.13'
ubuntu-version: ubuntu-latest
python-extra-dep: 'libgirepository-2.0-dev'
pygobject-version: ''
test_timeout_minutes: 6
- python-version: '3.14'
ubuntu-version: ubuntu-latest
python-extra-dep: 'libgirepository-2.0-dev'
pygobject-version: ''
test_timeout_minutes: 6
runs-on: ${{ matrix.ubuntu-version }}
env:
COVERAGE: "coverage run --include='bleachbit/*'"
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
appstream \
dbus \
dbus-x11 \
gettext \
gir1.2-gtk-3.0 \
gir1.2-notify-0.7 \
gnome-keyring \
libcairo2-dev \
libgirepository1.0-dev \
libnotify-bin \
libxml2-utils \
notification-daemon \
xvfb \
${{ matrix.python-extra-dep }}
# for tests.TestLanguage
sudo locale-gen es_ES.UTF-8
sudo locale-gen pl_PL.UTF-8
sudo locale-gen en_AU.UTF-8
sudo update-locale
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update Python packages
run: |
pip list
python -m pip install --upgrade pip
- name: Install Python dependencies
run: |
pip install coverage coveralls appveyor-artifacts -r requirements.txt
if [ "${{ matrix.pygobject-version }}" != "" ]; then
pip install "PyGObject${{ matrix.pygobject-version }}"
fi
if [ "${{ matrix.python-version }}" == "3.14" ]; then
pip install pytest pytest-xdist
fi
- name: Generate Revision.py
run: |
echo "revision = \"`git rev-parse --short HEAD`\"" > bleachbit/Revision.py
echo "build_number = \"${{ github.run_number }}\"" >> bleachbit/Revision.py
- name: Generate translations
run: make -C po local bleachbit.pot
- name: Run tests (regular and sudo)
timeout-minutes: ${{ matrix.test_timeout_minutes }}
run: |
export DISPLAY=":1.0"
export $(dbus-launch)
sudo Xvfb :1 -screen 0 800x600x24 &
sleep 5
if [ "${{ matrix.python-version }}" == "3.14" ]; then
dbus-run-session -- bash -c '/usr/lib/notification-daemon/notification-daemon & sleep 2 && xvfb-run -a bash -c "PYTHONPATH=. pytest -n auto"'
else
dbus-run-session -- bash -c '/usr/lib/notification-daemon/notification-daemon & sleep 2 && xvfb-run -a bash -c "make tests && make tests-with-sudo"'
fi
# appveyor-artifacts does not work with Python 3.13, and running once
# is enough.
- name: Combine Linux and Windows coverage, upload to Coveralls
if: matrix.python-version == '3.9'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Linux-only coverage before combine:"
coverage report
mv .coverage .coverage.ubuntu
appveyor-artifacts -o az0 -n bleachbit -m -c ${{ github.sha }} download
mv .coverage .coverage.windows
echo "Combined coverage:"
coverage combine
coverage report
coveralls