Skip to content

Commit

Permalink
Update linter and tests workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Lee committed Mar 5, 2024
1 parent c4352a2 commit 830ac00
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 67 deletions.
148 changes: 82 additions & 66 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,85 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint poetry
python -m poetry config virtualenvs.in-project true
python -m poetry export -f requirements.txt --output requirements.txt
- uses: Silleellie/pylint-github-action@v2
with:
# Path of the package(s) or python file(s) to lint, relative to the repository root.
# If more than one package (or python file) should be linted, simply specify all of them
# with the multi-line notation like so:
# lint-path: |
# src
# other_src
# main.py
# ...
#
# Required
lint-path: app

# Version of the Python interpreter which will install all requirements of your project
# and lint the package(s) or python file(s) specified with the `lint-path` argument
#
# Required
python-version: 3.9

# Path of the requirements of your project, relative to the repository root.
# This can be easily changed in case you have `requirements-dev.txt`
#
# Optional, Default: requirements.txt
# requirements-path: requirements.txt
# requirements-path: requirements.txt

# Path of the README.md to update with the pylint badge, relative to the repository root.
#
# Optional, Default: README.md
# readme-path: README.md

# Text to display in the badge
#
# Optional, Default: PyLint
# badge-text: PyLint

# Color of the badge for pylint scores < 5.
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: red
# color-bad-score: red

# Color of the badge for pylint scores in range [5,8).
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: orange
# color-ok-score: orange

# Color of the badge for pylint scores in range [8,10).
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: yellow
# color-good-score: yellow

# Color of the badge for pylint scores == 10.
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: brightgreen
# color-perfect-score: brightgreen
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install poetry
uses: abatilo/actions-poetry@v2

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Install the project dependencies
run: poetry install --only main

- name: Export requirements.txt
run: poetry export -f requirements.txt --output requirements.txt

- name: Lint with PyLint
uses: Silleellie/pylint-github-action@v2
with:
# Path of the package(s) or python file(s) to lint, relative to the repository root.
# If more than one package (or python file) should be linted, simply specify all of them
# with the multi-line notation like so:
# lint-path: |
# src
# other_src
# main.py
# ...
#
# Required
lint-path: app

# Version of the Python interpreter which will install all requirements of your project
# and lint the package(s) or python file(s) specified with the `lint-path` argument
#
# Required
python-version: "3.9"

# Path of the requirements of your project, relative to the repository root.
# This can be easily changed in case you have `requirements-dev.txt`
#
# Optional, Default: requirements.txt
# requirements-path: requirements.txt
# requirements-path: requirements.txt

# Path of the README.md to update with the pylint badge, relative to the repository root.
#
# Optional, Default: README.md
# readme-path: README.md

# Text to display in the badge
#
# Optional, Default: PyLint
# badge-text: PyLint

# Color of the badge for pylint scores < 5.
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: red
# color-bad-score: red

# Color of the badge for pylint scores in range [5,8).
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: orange
# color-ok-score: orange

# Color of the badge for pylint scores in range [8,10).
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: yellow
# color-good-score: yellow

# Color of the badge for pylint scores == 10.
# Hex, rgb, rgba, hsl, hsla and css named colors can all be used
#
# Optional, Default: brightgreen
# color-perfect-score: brightgreen
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down

0 comments on commit 830ac00

Please sign in to comment.