-
-
Notifications
You must be signed in to change notification settings - Fork 226
61 lines (49 loc) · 1.74 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
name: tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
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
# see: https://github.com/ymyzk/tox-gh-actions
- name: Run tests
run: tox
- 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:')"