-
Notifications
You must be signed in to change notification settings - Fork 11
66 lines (61 loc) · 1.85 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
name: main
on: [push, pull_request]
env:
FORCE_COLOR: "1"
PY_COLORS: "1"
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12-dev]
ubuntu-version: [ubuntu-latest, ubuntu-20.04]
runs-on: ${{ matrix.ubuntu-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-shape0 libxcb-cursor0 xserver-xephyr xvfb
- run: pip install tox
- run: tox -e py
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install tox
- run: tox -e py -- tests/test_xvfb_windows.py
lint:
runs-on: ubuntu-latest
strategy:
matrix:
env: [format, mypy]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install tox
- run: tox -e ${{ matrix.env }}
deploy:
runs-on: ubuntu-latest
needs: [tests, windows, lint]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Build package
run: |
python -m pip install --upgrade pip setuptools
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}