forked from Trusted-AI/adversarial-robustness-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (64 loc) · 1.93 KB
/
ci-style-checks.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
name: CI Style Checks
on:
# Run on manual trigger
workflow_dispatch:
# Run on pull requests
pull_request:
paths-ignore:
- '*.md'
# Run on merge queue
merge_group:
# Run when pushing to main or dev branches
push:
branches:
- main
- dev*
# Run scheduled CI flow daily
schedule:
- cron: '0 8 * * 0'
jobs:
style:
name: Style Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Pre-install
run: |
sudo apt-get update
sudo apt-get -y -q install ffmpeg libavcodec-extra
- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -q pylint==2.12.2 mypy==1.7.1 pycodestyle==2.8.0 black==21.12b0
pip install -q -r <(sed '/^numpy/d;/^pluggy/d;/^tensorflow/d;/^keras/d' requirements_test.txt)
pip install numpy==1.22.4
pip install pluggy==0.13.1
pip install tensorflow==2.13.1
pip install keras==2.13.1
pip install types-six
pip install types-PyYAML
pip install types-setuptools
pip install click==8.0.2
pip list
- name: pycodestyle
run: pycodestyle --ignore=C0330,C0415,E203,E231,W503 --max-line-length=120 art
- name: pylint
if: ${{ always() }}
run: pylint --disable=C0330,C0415,E203,E1136,E0401,E1102 -rn art
- name: mypy
if: ${{ always() }}
run: mypy art
- name: pytest-flake8
if: ${{ always() }}
run: pytest --flake8 -v -m flake8 --ignore=contrib
- name: black
if: ${{ always() }}
run: |
black --line-length 120 --check art/
black --line-length 120 --check tests/
black --line-length 120 --check examples/