main -> Lint ( 1 ) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Lint | |
on: | |
push: | |
branches: [master, main] | |
# only when python files are changed | |
paths: | |
- '**.py' | |
pull_request: | |
branches: [master, main] | |
workflow_dispatch: | |
# set the run-name | |
run-name: ${{ github.ref_name }} -> Lint ( | |
${{ github.run_attempt }} | |
) | |
jobs: | |
lint: | |
name: Lints the code using specified linters | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo current date and time | |
id: datetime | |
run: | | |
echo "datetime: $(date '+%Y-%m-%d %H:%M:%S')" | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.13 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install black | |
pip install ruff | |
pip install mypy | |
- name: Lint with black | |
run: | | |
black --check src | |
# ignore E501 (line too long) for now | |
- name: Lint with ruff | |
run: | | |
ruff check src --ignore=E501,I001 | |
- name: Lint with mypy | |
run: | | |
mypy src --ignore-missing-imports | |