-
Notifications
You must be signed in to change notification settings - Fork 86
43 lines (39 loc) · 1.38 KB
/
python-app.yml
File metadata and controls
43 lines (39 loc) · 1.38 KB
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
name: "MyPy, Tests, and Linting"
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: python3 python3-pip python3-setuptools python3-pytest python3-pytest-cov python3-pytest-xvfb python3-gi python3-xlib python3-dbus xvfb openbox zenity gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-wnck-3.0
version: 1.0
- uses: actions/setup-python@v5
with:
cache: "pip" # caching pip dependencies
cache-dependency-path: "**/dev_requirements.txt"
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
if [ -f dev_requirements.txt ]; then pip install -r dev_requirements.txt; fi
- name: Check types with MyPy
run: |
mypy --exclude=build .
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff check . --output-format=grouped --select=E9,F63,F7,F82
# exit-zero treats all errors as warnings
ruff check . --exit-zero --output-format=grouped
- name: Test with PyTest
run: |
python3 -m pytest
- name: Coveralls
uses: coverallsapp/github-action@v2