Repository navigation
79 lines (65 loc) · 2.11 KB
/
Copy pathtest.yml
File metadata and controls
79 lines (65 loc) · 2.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
name: test
on:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-14, macos-latest, ubuntu-latest, windows-2022, windows-latest ]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- pre-command: ""
pytest-run-prefix: ""
- os: "ubuntu-latest"
pre-command: |
sudo apt update -y
sudo apt install -y --no-install-recommends \
blackbox \
dbus-x11 \
dbus-user-session \
notification-daemon
mkdir -p /usr/share/dbus-1/services
echo '
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon
' > /usr/share/dbus-1/services/org.freedesktop.Notifications.service
# Start Virtual X server
echo "Start X server..."
Xvfb :99 -screen 0 2048x1536x24 &
sleep 1
DISPLAY=:99 dbus-launch
DISPLAY=:99 systemctl --user daemon-reload
# Start Window manager
echo "Start window manager..."
DISPLAY=:99 blackbox &
sleep 1
pytest-run-prefix: "DISPLAY=:99"
steps:
- uses: actions/checkout@v6
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: |
${{ matrix.pre-command }}
python -m pip install --upgrade pip
python -m pip install -U .[dev]
- name: test
run: |
${{ matrix.pytest-run-prefix }} pytest --verbose --cov=desktop_notifier --cov-report=xml
- name: upload code coverage
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: pytest
env_vars: OS,PYTHON
name: pytests
token: ${{ secrets.CODECOV_TOKEN }}
env:
OS: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}