forked from Akuli/porcupine
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 3.44 KB
/
check.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
on:
push:
branches:
- main
- bugfix-release
pull_request:
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- run: pip install wheel
- run: pip install -r requirements.txt -r requirements-dev.txt
- run: |
time mypy --platform linux --python-version 3.8 porcupine docs/extensions.py
time mypy --platform linux --python-version 3.9 porcupine docs/extensions.py
time mypy --platform linux --python-version 3.10 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.8 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.9 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.10 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.8 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.9 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.10 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.11 porcupine docs/extensions.py
pytest:
timeout-minutes: 10
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements.txt -r requirements-dev.txt
- if: matrix.os == 'ubuntu-latest'
# Make sure that it doesn't crash with Noto Color Emoji installed
run: sudo apt install --no-install-recommends fonts-noto-color-emoji tkdnd
- if: matrix.os == 'windows-latest'
run: |
python scripts/download-tkdnd.py
echo "TCLLIBPATH=lib" >> $env:GITHUB_ENV
- uses: GabrielBB/[email protected]
with:
run: python -m pytest --durations=10
# Separate from other pytests because tkinter doesn't work on macos with actions/setup-python.
# It imports, but gives this error: RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
pytest-macos:
timeout-minutes: 15
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
# TODO: how to install tkdnd on mac? add instructions to README or make mac app that bundles it
TCLLIBPATH: ./lib
PYTHON: /usr/local/opt/python@${{ matrix.python-version }}/libexec/bin/python
steps:
- uses: actions/checkout@v2
- run: brew install python@${{ matrix.python-version }}
# https://stackoverflow.com/a/66919851
- if: matrix.python-version != '3.8'
run: brew install python-tk@${{ matrix.python-version }}
- run: $PYTHON --version
- run: $PYTHON -m pip install -r requirements.txt -r requirements-dev.txt
- run: $PYTHON scripts/download-tkdnd.py
- run: $PYTHON -m pytest --durations=10
flake8-tkinter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
# TODO: adding these to requirements-dev.txt breaks pip install
- run: pip install flake8==5.0.4 flake8-tkinter==0.5.0
- run: python3 -m flake8 $(git ls-files | grep -E '\.(py|pyw)$')