-
-
Notifications
You must be signed in to change notification settings - Fork 226
75 lines (60 loc) · 2.15 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
name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [ push, pull_request ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-22.04, macos-latest ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
shell: bash
run: |
pip install tox tox-gh-actions
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt-get install libegl1 libopengl0
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install xorg
sudo apt-get install -y xvfb
fi
- name: Start Xvfb
if: matrix.os == 'ubuntu-22.04'
run: |
Xvfb :0 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:0
touch ~/.Xauthority
Xvfb :0 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:0
# see: https://github.com/ymyzk/tox-gh-actions
- name: Run tests
run: tox
- uses: actions/upload-artifact@v4
if: failure() && matrix.os == 'windows-latest' # 'ubuntu-22.04' or 'windows-latest'
with:
path: '**/screenshots/**'
name: ${{ matrix.python-version }}
- name: Stop Xvfb
if: matrix.os == 'ubuntu-22.04'
run: killall Xvfb
- name: Publish Style Summary
if: ${{ failure() || success() }}
run: |
python -c "from ci import report_style; report_style()"
- name: Publish Tests Summary
if: ${{ failure() || success() }}
run: |
pip install junitparser
python -c "from ci import report_tests; report_tests(header='## Unit-tests Report:')"