Skip to content

Commit f9216f5

Browse files
authored
add Python checks for Docker scripts (#4259)
fixes #4054
1 parent 7c9589c commit f9216f5

File tree

4 files changed

+235
-146
lines changed

4 files changed

+235
-146
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ jobs:
88
steps:
99
- name: Checkout master branch
1010
uses: actions/checkout@v3
11+
- uses: actions/setup-python@v4
12+
with:
13+
python-version: '3.10'
14+
- name: Install dependencies
15+
run: python3 -m pip install -r docker/requirements.txt
16+
- name: Install opengrok-tools
17+
run: python3 setup.py install
18+
working-directory: tools
19+
- name: Install checkers
20+
run: python3 -m pip install pylint flake8 black isort
21+
- name: Run flake8
22+
run: flake8 --max-line-length 119 docker/*.py
23+
- name: Run pylint
24+
run: pylint -E --max-line-length 119 docker/*.py
25+
- name: Run black in check mode
26+
run: black --check docker/*.py
27+
- name: Run isort in check mode
28+
run: isort --settings-file docker/.isort.cfg docker/*.py --check --diff
1129
- name: Build and optionally push Docker image
1230
env:
1331
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
@@ -16,9 +34,6 @@ jobs:
1634
OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
1735
OPENGROK_REF: ${{ github.ref }}
1836
run: ./dev/docker.sh
19-
- uses: actions/setup-python@v4
20-
with:
21-
python-version: '3.10'
2237
- name: Install Python pre-requisites
2338
run: python3 -m pip install requests
2439
- name: Optionally update README on Docker hub

docker/.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile = black

docker/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flask
2+
flask_httpauth
3+
waitress
4+
requests

0 commit comments

Comments
 (0)