-
Notifications
You must be signed in to change notification settings - Fork 50
114 lines (108 loc) · 3.76 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
on:
push:
branches:
- main
- bugfix-release
pull_request:
jobs:
mypy:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
matrix:
# Mypy running on platform A can check for platform B, so it all runs on linux.
# Multiple parallel jobs are needed only to make this faster.
mypy-platform: ["linux", "win32", "darwin"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
- run: |
time mypy --platform ${{ matrix.mypy-platform }} --python-version 3.9 porcupine
time mypy --platform ${{ matrix.mypy-platform }} --python-version 3.10 porcupine
time mypy --platform ${{ matrix.mypy-platform }} --python-version 3.11 porcupine
pytest-windows:
timeout-minutes: 10
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
- name: Download tkdnd
run: |
python scripts/download-tkdnd.py
echo "TCLLIBPATH=lib" >> $env:GITHUB_ENV
- run: python -m pytest --durations=10
pytest-linux:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
# Make sure that it doesn't crash with Noto Color Emoji installed
- run: sudo apt install --no-install-recommends fonts-noto-color-emoji tkdnd xvfb
- run: xvfb-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
# TODO: run tests on M1 macos when we no longer need tree-sitter-builds.
# This was never supported by tree-sitter-builds: https://github.com/Akuli/py-tree-sitter-builds/issues/11
runs-on: macos-13 # latest intel mac
strategy:
matrix:
python-version: ["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@v4
- run: brew install python@${{ matrix.python-version }}
- run: brew install python-tk@${{ matrix.python-version }}
- run: $PYTHON --version
- run: $PYTHON -m pip install -r requirements-dev.txt
- run: $PYTHON scripts/download-tkdnd.py
- run: $PYTHON -m pytest --durations=10
flake8-tkinter:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
# TODO: adding these to requirements-dev.txt breaks pip install
- run: pip install flake8=='7.*' flake8_tkinter==0.6.0
- run: python3 -m flake8 --select=TK $(git ls-files | grep -E '\.(py|pyw)$')
markdown-links:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install requests
- run: python3 scripts/check-markdown-links.py