Skip to content

Commit

Permalink
two jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
bloombar committed Nov 25, 2023
1 parent 57df84b commit f3eeb7b
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,59 @@ name: check lint and format
on: [push, pull_request]

jobs:
lint:
lint-web-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.10" # update version(s) as needed
- name: Install dependencies
if: ${{ hashFiles('**/*.py') != '' }}
if: ${{ hashFiles('web-app/**/*.py') != '' }}
run: |
cd web-app
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv sync --dev --python $(which python)
pipenv shell --fancy --python $(which python)
- name: Lint with pylint
if: ${{ hashFiles('**/*.py') != '' }}
if: ${{ hashFiles('web-app/**/*.py') != '' }}
# you may set pylint to ignore any files or dependencies that make no sense to lint
run: |
cd web-app
pipenv run pylint **/*.py
- name: Format with black
if: ${{ hashFiles('**/*.py') != '' }}
if: ${{ hashFiles('web-app/**/*.py') != '' }}
# you may set black to ignore any files or dependencies that make no sense to format
run: |
cd web-app
pipenv run black --diff --check .
lint-machine-learning-client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10" # update version(s) as needed
- name: Install dependencies
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
run: |
cd machine-learning-client
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv sync --dev --python $(which python)
pipenv shell --fancy --python $(which python)
- name: Lint with pylint
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
# you may set pylint to ignore any files or dependencies that make no sense to lint
run: |
cd machine-learning-client
pipenv run pylint **/*.py
- name: Format with black
if: ${{ hashFiles('machine-learning-client/**/*.py') != '' }}
# you may set black to ignore any files or dependencies that make no sense to format
run: |
cd machine-learning-client
pipenv run black --diff --check .

0 comments on commit f3eeb7b

Please sign in to comment.