-
Notifications
You must be signed in to change notification settings - Fork 47
78 lines (71 loc) · 2.3 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
name: Static analysis
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
lint_and_typing:
container:
image: quay.io/fedora/fedora:latest
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Install build and check environment
run: |
dnf install --assumeyes --setopt=install_weak_deps=False \
autoconf automake dnf-plugins-core make \
python3-ipython python3-mypy python3-pip python3-pylint
dnf copr enable --assumeyes @abrt/faf-el8-devel
pip install types-flask types-flask-sqlalchemy types-jsonschema \
types-python-dateutil types-requests types-sqlalchemy
- name: Generate build files
run: ./autogen.sh
- name: Install build dependencies
run: dnf builddep --assumeyes --setopt=install_weak_deps=False --spec faf.spec
- name: Build
run: make -j
- name: Run Mypy
run: |
stubgen --verbose --output mypy_stubs \
--package bugzilla \
--package celery \
--package dnf \
--package fedora_messaging \
--package flask_openid \
--package IPython \
--package koji \
--package markdown2 \
--package munch \
--package ratelimitingfilter \
--package rpm \
--package satyr \
--package werkzeug \
--package wtforms
# Typecheck library modules.
MYPYPATH=$(pwd)/mypy_stubs mypy \
--config-file=mypy.ini \
src/pyfaf/ \
src/schema/faf_schema/ \
src/webfaf/ \
src/webfaf/hub.wsgi
# Typecheck runnable scripts.
MYPYPATH=$(pwd)/mypy_stubs:$(pwd)/src/ mypy \
--config-file=mypy.ini \
--scripts-are-modules \
src/bin/faf \
src/bin/faf-migrate-db
- name: Run Pylint
if: always()
run: |
python3 -m pylint \
--rcfile=pylintrc \
--output-format=colorized \
src/bin/faf \
src/bin/faf-migrate-db \
src/webfaf/hub.wsgi \
$(find src -name '*.py')
- name: Fail if failed
if: failure()
run: false